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

get the most repeated data 1

Status
Not open for further replies.

tuzojazz

Programmer
Dec 26, 2005
58
MX
Hi:

suposse I have this table named "Employees"

Employees
-----------------------

Emloyee Country
-------------------------
John Italy
Geroge Germany
Steve Mexico
Jim Germany
Brian Germany
Richard Italy

I want to get the countries in order where are the most of the employees
------------
Germany
Italy
Mexico
----------

another example

Employees
-----------------------
Emloyee Country
-------------------------
Brian Germany
Geroge Mexico
John Italy
Steve Mexico
Jim Mexico
Richard Italy

I want to get this order

----------------
Mexico
Italy
Germany
---------------



how can I do this query?

Thanks!!
 
Do you mean:

[tt]SELECT Country
FROM tblTable
GROUP BY Country
ORDER BY Count(Country) DESC;[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top