I have a database table with first and last names (and other stuff)... and what I need is a query that will find the top ten first names that are used in the database table.
I have been able to get a query to show the distinct names in alpha order...
SELECT DISTINCT FName
FROM Users
ORDER BY FName ASC;
and a query to get the count of specific names..
SELECT COUNT(FName) AS 'NameCount'
FROM Users
WHERE FName = 'joe'
But... is there a way to combine these queries so that i can get a result like this...
#1 Joe - 550
#2 Tom = 453
#3 Bill = 423
#4 John = 321
etc...
Any SQL Gurus out there who have done this before? Seems like it should not bee that tough... I just can't figure out how to even start doing it!
Thanks