We are currently translating all queries to SAP HANA.
Can anyone please tell me how an "OUTER APPLY" works in HANA?
See my query below.
After the last join I used an "OUTER APPLY".
Kind regards, William
SELECT * FROM [dbo].[RDR1] T0 INNER JOIN dbo.ORDR T1 ON T1.DocEntry = T0.DocEntry OUTER APPLY (SELECT TOP 1 T20.U_DocType, T20.U_LineNum, T21.ItemCode FROM dbo.[@CUSTOMTABLE] T20 INNER JOIN dbo.OITM T21 ON T20.U_Treatment = T21.ItemCode WHERE T20.U_DocEntry = T0.DocEntry AND T0.ObjType = T20.U_DocType AND T0.LineNum = T20.U_LineNum AND T21.U_Type IN ('A', 'B') AND ISNULL(T20.U_Cut, 0) > 0) T13