Selecting top values from columns
How can I find top 5 countries with highest population per continent. I
just want to use below 1 table:
URL: http://dev.mysql.com/doc/index-other.html
Database: world database (MyISAM version, used in MySQL certifications and
training)
Below is what I came up with:
select Continent,
substring_index(
GROUP_CONCAT(distinct cast(Name as char)), ',', 5)
From
country
group by
Continent,Name;
Thanks, Rio
No comments:
Post a Comment