Wednesday, February 26, 2014

Query to differenciate customer and suppliers data in hz_parties table in Oracle R12

select * from (
select hp.party_number,hp.party_name,hp.status,decode(nvl(hpu.party_usage_code,hp.party_type),'ORGANIZATION','CUSTOMER',nvl(hpu.party_usage_code,hp.party_type)) party_type
from  HZ_PARTY_USG_ASSIGNMENTS hpu,hz_parties hp
where hp.party_id = hpu.party_id(+))
order by party_type