Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Create view Categories
- as Select Category = b.Category, QtySold =coalesce(sum(ordde.Qty), '0'), TotalRevenue = coalesce(sum(ordde.Price * ordde.Qty), '0')
- from Book b
- left join OrderDetail ordde on b.ISBN = ordde.ISBN
- group by b.Category
- go
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement