DBA Data[Home] [Help]

VIEW: APPS.IMC_DUPL_ORG_KEY_V

Source

View Text - Preformatted

SELECT x.concat_key, x.customers, to_char(round(x.customers*100/y.tot,2)) percent from (select a.customer_key||b.address_key concat_key, count(a.party_id) customers from hz_parties a, hz_locations b, hz_party_sites c WHERE a.party_id = c.party_id (+) and c.identifying_address_flag (+) = 'Y' and b.location_id (+) = c.location_id and party_type = 'ORGANIZATION' group by a.customer_key||b.address_key) x, (select count(party_id) tot from hz_parties where party_type='ORGANIZATION') y
View Text - HTML Formatted

SELECT X.CONCAT_KEY
, X.CUSTOMERS
, TO_CHAR(ROUND(X.CUSTOMERS*100/Y.TOT
, 2)) PERCENT
FROM (SELECT A.CUSTOMER_KEY||B.ADDRESS_KEY CONCAT_KEY
, COUNT(A.PARTY_ID) CUSTOMERS
FROM HZ_PARTIES A
, HZ_LOCATIONS B
, HZ_PARTY_SITES C
WHERE A.PARTY_ID = C.PARTY_ID (+)
AND C.IDENTIFYING_ADDRESS_FLAG (+) = 'Y'
AND B.LOCATION_ID (+) = C.LOCATION_ID
AND PARTY_TYPE = 'ORGANIZATION' GROUP BY A.CUSTOMER_KEY||B.ADDRESS_KEY) X
, (SELECT COUNT(PARTY_ID) TOT
FROM HZ_PARTIES
WHERE PARTY_TYPE='ORGANIZATION') Y