Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- koko.*, MAX(koko.currency_usage) AS maxy
- FROM
- (SELECT
- c.continent_code,
- v.currency_code,
- COUNT(c.currency_code) AS 'currency_usage'
- FROM
- countries AS c
- JOIN currencies AS v ON c.currency_code = v.currency_code
- GROUP BY c.continent_code , v.currency_code
- HAVING `currency_usage` > 1
- ORDER BY c.continent_code , v.currency_code) AS koko
- GROUP BY koko.continent_code;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement