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

Counting the greatest number

Status
Not open for further replies.

peljo

Technical User
Joined
Mar 3, 2006
Messages
91
Location
BG

I want to build a query with which to find the greatest number of figures in the field.I have a field called Plates where single numbers are entered.For example

Visits Plates
John 3
Jim 3
Deuce 3
Liza 3
Lenny 1
Lorry 6

Obvisouly in the above example we can count that the number 3 is the biggest number.
How can i express that in a query ?
 
select top 1 Plates, count(*)
from daTable
group by Plates
order by count(*) desc

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top