Guest User

Untitled

a guest
Jul 17th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. SELECT *
  2. FROM (SELECT medicine_name, YEAR_OF_PURCHASE, profit_in_rupees FROM temp_1
  3. )
  4. PIVOT
  5. (AVG (NVL (profit_in_rupees, 0)) AS avg_profit
  6. FOR (year_of_purchase)
  7. IN ('2017' AS "2017", '2018' AS "2018"))
  8. ORDER BY medicine_name;
Add Comment
Please, Sign In to add comment