Hi,
I have problem about writing a proper SELECT query for the following
goal:
Table name: peoplelist
column 1: id (not NULL, auto_incrementa l)
column 2: name
column 3: country
now, there are about 7,000 rows in this table. I want to select out:
first 10 or less people in the table for each country.
for example: suppose there are :
1000 people from US
3000 people from UK
3000 people from Canada
I want to list totally 30 people, i.e. 10 people from each country.
The problem is , the actual table includes many countries, not only
three. How can I do this by a SELECT sql query ?
Thanks.
Han
I have problem about writing a proper SELECT query for the following
goal:
Table name: peoplelist
column 1: id (not NULL, auto_incrementa l)
column 2: name
column 3: country
now, there are about 7,000 rows in this table. I want to select out:
first 10 or less people in the table for each country.
for example: suppose there are :
1000 people from US
3000 people from UK
3000 people from Canada
I want to list totally 30 people, i.e. 10 people from each country.
The problem is , the actual table includes many countries, not only
three. How can I do this by a SELECT sql query ?
Thanks.
Han
Comment