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