Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT rankedCurrencies.ContinentCode, rankedCurrencies.CurrencyCode, rankedCurrencies.Count
- FROM (
- SELECT c.ContinentCode, c.CurrencyCode, COUNT(c.CurrencyCode) AS [Count], DENSE_RANK() OVER (PARTITION BY c.ContinentCode ORDER BY COUNT(c.CurrencyCode) DESC) AS [rank]
- FROM Countries AS c
- GROUP BY c.ContinentCode, c.CurrencyCode) AS rankedCurrencies
- WHERE rankedCurrencies.rank = 1 and rankedCurrencies.Count > 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement