Try

SELECT Count(Name)
FROM tablename
GROUP BY yearofbirth

On 7/27/07, B V, Phanisekhar <[EMAIL PROTECTED]> wrote:
> 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
>
>


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation http://www.osgeo.org/education/
S&T Policy Fellow, National Academy of Sciences http://www.nas.edu/
---------------------------------------------------------------------
collaborate, communicate, compete
=====================================================================

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

Reply via email to