Tuesday, May 29, 2012

sql for customer bill to address

SELECT c.site_use_id,

a.cust_account_id,

e.address1,

e.address2,

e.address3,

e.address4,

e.postal_code,

e.province,

e.state,

country

FROM hz_cust_accounts a,

hz_cust_acct_sites_all b,

hz_cust_site_uses_all c,

hz_party_sites d,

hz_locations e

WHERE a.cust_account_id = b.cust_account_id

AND b.cust_acct_site_id = c.cust_acct_site_id

AND b.party_site_id = d.party_site_id

AND d.location_id = e.location_id

AND c.site_use_code = 'BILL_TO'

AND c.status = 'A'

AND b.org_id = c.org_id

AND b.org_id = 160

AND a.cust_account_id IN (595595, 555158)

1 comment:

Oleg said...

I want to share a testimony on how Le_Meridian funding service helped me with loan of 2,000,000.00 USD to finance my marijuana farm project , I'm very grateful and i promised to share this legit funding company to anyone looking for way to expand his or her business project.the company is UK/USA funding company. Anyone seeking for finance support should contact them on lfdsloans@outlook.com Or lfdsloans@lemeridianfds.com Mr Benjamin is also on whatsapp 1-989-394-3740 to make things easy for any applicant.