Guest User

Untitled

a guest
Jan 19th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. Items
  2. ItemId ItemName
  3. 444 Item-1
  4. 555 Item-2
  5. 666 Item-3
  6.  
  7. Locations
  8. LocationId LocationName
  9. 12 Loc1
  10. 13 Loc2
  11. 14 Loc3
  12. 15 Loc4
  13. 17 Loc5
  14.  
  15.  
  16. Stock
  17. Id ItemId LocationId stock
  18. 1 444 12 2
  19. 2 444 13 15
  20. 3 555 14 20
  21. 4 666 15 14
  22. 5 666 17 12
  23.  
  24. Result Table
  25. ItemName LocationName stock
  26. Item-1 Loc2 15
  27. Item-2 Loc3 20
  28. Item-3 Loc4 14
  29.  
  30. Select I.ItemName,L.LocationName,S.stock from Items I
  31. inner join Stock S on
  32. I.ItemId = S.ItemId
  33. inner join Locations L on
  34. S.LocationId = L.LocationId
Add Comment
Please, Sign In to add comment