Multiple records fetched when querying for the contact person of a supplier
Hi,
There is a requirement to fetch contact details of Supplier. The contact is for the vendor and not at the site level.
I prepared the below query.
select asup.vendor_name
,asup.segment1 vendor_number
,org_party.party_name organization
,cont_party.party_name contact_person
,cont_party.party_number contact_person_number
from hz_org_contacts hoc
,hz_relationships hr
,hz_parties org_party
,hz_parties cont_party
,ap_suppliers asup
where hr.relationship_id = hoc.party_relationship_id
and hr.subject_id = cont_party.party_id
and hr.subject_table_name = 'HZ_PARTIES'
and hr.relationship_code = 'CONTACT_OF'