Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Task 7
- Find all user in games with information about them. Display the game name, game type, username, level, cash and character name. Sort the result by level in descending order, then by username and game in alphabetical order. Submit for evaluation the result text comma separated with headers.
- select
- g.Name as Game,
- gt.Name as [Game Type],
- u.Username,
- ug.Level as [Level],
- ug.Cash,
- c.Name as [Character]
- from Games g
- join UsersGames ug
- on g.Id = ug.GameId
- join Users u
- on ug.UserId = u.Id
- join GameTypes gt
- on g.GameTypeId = gt.Id
- join Characters c
- on ug.CharacterId = c.Id
- order by ug.[Level] desc, u.Username asc, g.Name asc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement