Hello,
The query below returns duplicate rows from the inner join with TB901. I tried to add DISTINCT to the inner join as A.ENTITYID = DISTINCT B.ENTITYID and I got a syntax error. How can i return distinct rows from the second table when I use inner join?
Thank you so much!
SELECT A.ENTITYID, A.CREDTAMT, B.PRMLNAME
FROM ADUADS01.ADVTB945 A
INNER JOIN ADUADS01.ADVTB901 B ON A.ENTITYID = B.ENTITYID
WHERE A.ALLOCNBR = '3982800'
AND A.CREDTAMT > 0
AND A.LEGCRAMT = 0
AND A.TRANTYPE = 'GI'