/scripts/ahub.form.attachments.js
0

OUTER APPLY in SAP HANA

Dec 21, 2016 at 03:05 PM

125

avatar image

Hi Guys,

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".

Thanks!

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
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers

Skip to Content