Greetings experts. I would like to join three tables together. I have the first two joined correctly (I think). However when I attempt to join the third table my records seem to double. The first syntax that joins my first two tables is shown below. I included some parameters which gives me a result of twelve returned records. I have verified that this is returning the correct amount. The query is as follows:
SELECT PO_RT_COMMIT_DETL.PO_ID AS POID, PO_RT_COMMIT_DETL.PO_RLSE_NO, PO_RT_COMMIT_DETL.PO_LN_KEY, PO_RT_COMMIT_DETL.VEND_NAME,
PO_RT_COMMIT_DETL.PROJ_ID, PO_RT_COMMIT_DETL.ORG_ID, PO_RT_COMMIT_DETL.ACCT_ID,
FROM DELTEK.PO_HDR INNER JOIN DELTEK.PO_RT_COMMIT_DETL ON DELTEK.PO_HDR.PO_ID = DELTEK.PO_RT_COMMIT_DETL.PO_ID
WHERE PROJ_ID = '10371.0001.0004'
AND S_PO_STATUS_TYPE = 'O'
AND PO_OPEN_AMT > '0.00'
AND PO_RT_COMMIT_DETL.PO_ID = 'PO-0051938'
ORDER BY POID
My third table is essential PO LN detail data. This also contains twelve records and the syntax is shown below:
where PO_ID = 'PO-0051938'
How do I join this third table to the above without duplicating records?