Hi Phanisekhar

Try this query..

Select yearofbirth, count(yearofbirth) from <yearofbirthtable> group by
yearofbirth;


-----Original Message-----
From: B V, Phanisekhar [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 27, 2007 8:31 PM
To: [email protected]
Subject: [sqlite] sql query required

Suppose I have a table:

 

Create table "yearofbirth INTEGER, Name string"

 

What will be the query to identify how many people were born in
different years? The output should contain all the years that are
present in the table and the total count corresponding to each entry.

 

Eg:

 

1901          rahul

1902          deepak

1901          joy

1945          deep

1953          preeti

1945          saum

 

The output should be

 

1901          2

1902          1

1945          2

1953          1

 

One can use GROUP BY.

 

Regards,

Phanisekhar


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
[EMAIL PROTECTED]
**********************************************************************


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to