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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

distinct records with a count

Status
Not open for further replies.

mmaddox

IS-IT--Management
May 22, 2002
53
US
How would I get a list of distinct records, with a count of how many occurances of each there are?

I want it to look like this:

NAME COUNT
John 5
Tom 10
Nancy 25

I think it would use DISTINCT and COUNT, but I can't seem to get it. this doesn't work:
SELECT DISTINCT name, count([name]) as expr1

thanx for any help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top