Reputation: 594
Hi i've the below query in oracle to get data. it is working fine in sql server, but, when i tried to execute this in oracle it is giving and error.
SELECT PRODUCT, FRED, KATE FROM (
SELECT CUST, PRODUCT, QTY
FROM Product
)
PIVOT
(
SUM(QTY) FOR CUST IN (FRED, KATE)
)
ORDER BY Product
Error:
and the table o/p is as below
Thanks
Upvotes: 0
Views: 410
Reputation: 10941
Try SUM(QTY) FOR CUST IN ('FRED' as fred , 'KATE' as kate)
Upvotes: 2