Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT TOP(5) c.Id, c.[Name] AS City, c.CountryCode AS Country, COUNT(a.Id) AS Accounts
- FROM Accounts AS a
- JOIN Cities AS c ON c.Id = a.CityId
- GROUP BY c.Id,c.[Name],c.CountryCode
- ORDER BY Accounts DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement