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

Reply via email to