DBA Data[Home] [Help]

VIEW: APPS.IMC_INDUSTRY_RPT_V

Source

View Text - Preformatted

SELECT nvl(ar.meaning,'Undefined') Industry, a.category_code, customers, to_char(round(a.customers*100/b.tot,2)) percent from (select category_code, count(*) customers from hz_parties where party_type = 'ORGANIZATION' group by category_code) a, (select count(*) tot from hz_parties where party_type = 'ORGANIZATION') b, ar_lookups ar WHERE ar.lookup_type (+) = 'CUSTOMER_CATEGORY' and ar.lookup_code (+) = a.category_code union select 'TOTAL', 'TOTAL', count(*), '100.00' from hz_parties where party_type = 'ORGANIZATION' order by 3 asc
View Text - HTML Formatted

SELECT NVL(AR.MEANING
, 'UNDEFINED') INDUSTRY
, A.CATEGORY_CODE
, CUSTOMERS
, TO_CHAR(ROUND(A.CUSTOMERS*100/B.TOT
, 2)) PERCENT
FROM (SELECT CATEGORY_CODE
, COUNT(*) CUSTOMERS
FROM HZ_PARTIES
WHERE PARTY_TYPE = 'ORGANIZATION' GROUP BY CATEGORY_CODE) A
, (SELECT COUNT(*) TOT
FROM HZ_PARTIES
WHERE PARTY_TYPE = 'ORGANIZATION') B
, AR_LOOKUPS AR
WHERE AR.LOOKUP_TYPE (+) = 'CUSTOMER_CATEGORY'
AND AR.LOOKUP_CODE (+) = A.CATEGORY_CODE UNION SELECT 'TOTAL'
, 'TOTAL'
, COUNT(*)
, '100.00'
FROM HZ_PARTIES
WHERE PARTY_TYPE = 'ORGANIZATION' ORDER BY 3 ASC