Pivot Monthly Revenue by Product
Pivot the sales so that each product has one row and three columns Jan, Feb and Mar with the revenue of that month (0 when none). Order by product.
Table schema
Sales(product VARCHAR(20), month VARCHAR(3), revenue INT)Sample data
product | month | revenue
Pen | Jan | 10
Pen | Mar | 5
Book | Feb | 20
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.