Advertisement
Guest User

--Task 11

a guest
Jul 14th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. --Task 11
  2. Find all items and information whether and what forbidden game types they have. Display item name, price, min level and forbidden game type. Display all items. Sort the results by game type in descending order, then by item name in ascending order.
  3.  
  4. select
  5. i.Name as Item,
  6. i.Price,
  7. i.MinLevel,
  8. gt.Name as [Forbidden Game Type]
  9. from Items i
  10. left join GameTypeForbiddenItems gtfi
  11. on i.Id = gtfi.ItemId
  12. left join GameTypes gt
  13. on gtfi.GameTypeId = gt.Id
  14. order by [Forbidden Game Type] desc, i.Name asc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement