count problem (1 Viewer)

Thedon123

Registered User.
Local time
Today, 10:39
Joined
Sep 11, 2002
Messages
98
I have records as below

a 1
b 1
c 1
a 2
b 2
a 3

i am trying to count the number of records for 1 and the number of records in 2 and the number of records in 3 separately.

How can i do this
 

Fizzio

Chief Torturer
Local time
Today, 10:39
Joined
Feb 21, 2002
Messages
1,885
use a GROUP BY clause in your query.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:39
Joined
Feb 19, 2002
Messages
43,484
I'll expand a little:

Select SomeField, Count(*) as CountOfField
From YourTable
Group By SomeField;
 

Users who are viewing this thread

Top Bottom