Friday, December 14, 2018

How to differentiate customer and suppliers data in hz_parties table?

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;

No comments:

Post a Comment