Guest User

Untitled

a guest
Oct 18th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. CREATE VIEW vwTopStackedItems
  2. AS
  3. SELECT TOP 20 MAX(inventorySlot.quantity) AS 'Top Stacked', item.itemName AS 'Item Name'
  4. FROM inventorySlot
  5. JOIN item
  6. ON inventorySlot.itemID = item.itemID
  7. JOIN character
  8. ON inventorySlot.characterID = character.characterID
  9. WHERE quantity > 1
  10. GROUP BY itemName
  11. ORDER BY MAX(quantity) DESC
  12. GO
  13.  
  14.  
  15. SELECT * FROM vwTopStackedItems
  16. GO
Add Comment
Please, Sign In to add comment