Multiple vendor contacts for a vendor,need to extact one
We have setup a XYZ vendor for whom we have assigned 2 contacts. when we are fetching all the payments for this vendor as there exists 2 conatcs each payment is being shown twice with 2 different conatct information.
But we need only one conatct information to be fetched. Could anyone please help on it.
Please find attched the below query.
SELECT distinct
rtrim(ltrim(v.vendor_name,' '),' ')
,to_char(c.check_number)
, HP2.email_address
,HP2.PRIMARY_PHONE_AREA_CODE
,HP2.PRIMARY_PHONE_NUMBER
,HP.PERSON_FIRST_NAME FIRST_NAME_ALT
,HP.PERSON_LAST_NAME LAST_NAME_ALT