Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT *
- FROM (SELECT medicine_name, YEAR_OF_PURCHASE, profit_in_rupees FROM temp_1
- )
- PIVOT
- (AVG (NVL (profit_in_rupees, 0)) AS avg_profit
- FOR (year_of_purchase)
- IN ('2017' AS "2017", '2018' AS "2018"))
- ORDER BY medicine_name;
Add Comment
Please, Sign In to add comment