I use the following query quite a bit, but I'm sure there should be a more efficient way to do this.
Basically, I believe that for a decade people were born from a user table:
select count(*) as howmany, yyyy from bday where (((yyyy > '1949') AND (yyyy < '1961')) AND (user_id = '63')) UNION select count(*) as howmany, yyyy from bday where (((yyyy > '1959') AND (yyyy < '1971')) AND (user_id = '63')) UNION select count(*) as howmany, yyyy from bday where (((yyyy > '1969') AND (yyyy < '1981')) AND (user_id = '63')) UNION select count(*) as howmany, yyyy from bday where (((yyyy > '1979') AND (yyyy < '1991')) AND (user_id = '63')) UNION select count(*) as howmany, yyyy from bday where (((yyyy > '1989') AND (yyyy < '2001')) AND (user_id = '63'))
source share