Advertisement
ZhengLu

Untitled

Oct 30th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. Create view Categories
  2. as Select Category = b.Category, QtySold =coalesce(sum(ordde.Qty), '0'), TotalRevenue = coalesce(sum(ordde.Price * ordde.Qty), '0')
  3. from Book b
  4. left join OrderDetail ordde on b.ISBN = ordde.ISBN
  5. group by b.Category
  6. go
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement