Dear all,
Below query gives error like : SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "Pivot": line 23 col 1 (at pos 495)
SELECT "CustCode"
as "Custcode",
"1" as "Jan",
"2" as "Feb",
"3" as "Mar",
"4" as "Apr",
"5" as "May",
"6" as "june",
"7" as "July",
"8" as "Aug",
"9" as "Sept",
"10" as "Oct",
"11" as "Nov",
"12" as "Dec"
From
(select T0."CardCode" as "Custcode", sum(T0."PlannedQty") as "PlanQty",month(T0."DueDate") as "Month"
from OWOR T0
where T0."Status" NOT IN ( 'C' ) and year(T0."DueDate") = 2021 group by T0."CardCode",T0."DueDate" )s
Pivot
(sum("PlanQty") for month IN ("1","2","3","4","5","6","7","8","9","10","11","12")) P
order by "CustCode"
Regards,
Nikunj