Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MYSQL Query Help for newbie please

Status
Not open for further replies.

davy33

Technical User
Jun 20, 2003
2
IE
Can someone help me with this one please I'm pretty new to MYSQL

I have a database with one table MEMBERS

there are 2 fields relevant to my query

COUNTRY, MEMBERNAME

I want to do the following

List the COUNTRY names alphabetically

A-COUNTRY
B-COUNTRY
C-COUNTRY

and display how many MEMBERNAME there are per COUNTRY

In esscence I want to display results by counting the number of rows per COUNTRY that contain a MEMBERNAME so that I wind up with something like the following


USA 630 Members
Ireland 330 Members
Taiwan 400 Members

etc.


Thanks for you help in advance

 
Code:
select country,count(*) as members
  from members
 group by country
 order by country
 
Thank you so much, that saved my bacon today
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top