SELECT party.party_id
,cust_acct.cust_account_id
,party_site.party_site_id
,party_site.location_id
,cust_acct_site.cust_acct_site_id
,cust_site_use.site_use_id
,cust_site_use.site_use_code
,party.party_name
,location.address1
,location.address2
,location.city
,location.state
,location.postal_code
FROM hz_parties party
,hz_cust_accounts cust_acct
,hz_party_sites party_site
,hz_cust_acct_sites_all cust_acct_site
,hz_cust_site_uses_all cust_site_use
,hz_locations location
WHERE party.party_id = cust_acct.party_id
AND party_site.party_id = party.party_id
AND party_site.party_site_id = cust_acct_site.party_site_id
AND cust_acct_site.cust_account_id = cust_acct.cust_account_id
AND cust_site_use.cust_acct_site_id = cust_acct_site.cust_acct_site_id
AND cust_site_use.site_use_code = 'BILL_TO'
AND party_site.location_id = location.location_id
AND cust_acct.account_number = '123456789'
No comments:
Post a Comment