Skip to Content
author's profile photo Former Member
Former Member

SQL Query to HANA

Good day

I have the following query that displays price changes in the price lists. It is working perfectly on SQL, but not on HANA. I kindly seek for assistance to convert it to HAVA version.

Select T0.itemcode, T2.ItemName, T7.listname, T0.Price as Current Price, T1.Price as Previous Price, T2.UpdateDate

From OITM T2 Inner Join ITM1 T0 on T0.Itemcode = T2.itemcode inner join AIT1 t1 on T0.ItemCode = t1.ItemCode and T0.PriceList = t1.pricelist Inner join OPLN T7 on T0.PriceList = T7.ListNum

Where T0.Price not in( T1.price ) and t1.LogInstanc in (Select Top 1 t9.LogInstanc from AIT1 T9 where t9.ItemCode = t1.ItemCode and t1.PriceList = T9.PriceList order by T9.LogInstanc desc) AND T0.PriceList IN (10) AND DATEDIFF(Day, T2.UpdateDate, GETDATE()) <= 3 Group By t0.itemcode, t0.pricelist, T7.ListName, T2.UpdateDate, T0.Price, t1.Price, T2.ItemName

Order By t0.itemcode, T0.PriceList


Trenna Lunga

Add comment
10|10000 characters needed characters exceeded

0 Answers