Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Same table repeat in from clause

Hi,

How do we write query where the same table is repeated more than once since that table has to be join with more than one table .Pls advise.

Rgds,

Rajeev

Former Member
Former Member replied

You can try this rewrite query to see if the results are the same:

SELECT DISTINCT T1.DocEntry 'GR No', T1.ItemCode 'Part No.', 
T1.Dscription 'Part Description', T0.SuppSerial 'DateCode', 
T0.Quantity 'Qty', T2.Custom,T1.Price, T2.Cost 
FROM PDN1 T1 
LEFT JOIN IPF1 T2 ON T2.BaseEntry = T1.DocEntry AND 
T1.ItemCode = T2.ItemCode AND T2.Origline = T1.LineNum
LEFT JOIN OIBT T0 ON T1.LineNum = T0.BaseLinNum AND 
T0.BaseNum = T1.DocEntry AND T0.ItemCode = T1.ItemCode

There are not two alias but one. If you still has duplicate records, it means you have to omit the column with difference data if you can.

Thanks,

Gordon

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question