[go: up one dir, main page]

0% found this document useful (0 votes)
27 views1 page

SQL Query for Party and Site Status

The document contains a SQL query designed to retrieve details about parties, their associated sites, and the status of those sites. It joins multiple tables including hz_parties, hz_party_sites, and hz_cust_accounts based on specific conditions. The query filters results based on provided party and organization IDs.

Uploaded by

Kum A
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views1 page

SQL Query for Party and Site Status

The document contains a SQL query designed to retrieve details about parties, their associated sites, and the status of those sites. It joins multiple tables including hz_parties, hz_party_sites, and hz_cust_accounts based on specific conditions. The query filters results based on provided party and organization IDs.

Uploaded by

Kum A
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

--THis query will display party details , party site and site details are active or

inactive

SELECT hp.party_id,
hp.party_name,
hp.party_number,
hps.party_site_id,
hcas.org_id,
hpsu.site_use_type,
hps.party_site_number,
hp.status hz_parties,
hps.status hz_party_sites,
hpsu.status hz_party_site_uses,
hcsu.site_use_code,
ca.status hz_cust_accounts,
hcas.status hz_cust_acct_sites_all,
hcsu.status hz_cust_site_uses_all
FROM hz_parties hp,
hz_party_sites hps,
hz_party_site_uses hpsu,
hz_cust_accounts ca,
hz_cust_acct_sites_all hcas,
hz_cust_site_uses_all hcsu
WHERE hp.party_id = hps.party_id
AND hp.party_id = ca.party_id
AND hps.party_site_id = hcas.party_site_id
AND hcsu.cust_acct_site_id = hcas.cust_acct_site_id
AND hps.party_site_id = hpsu.party_site_id
AND hcsu.site_use_code = hpsu.site_use_type
AND hp.party_id = :party_id
AND hcas.org_id = :org_id;

You might also like