The query displays the age group of users from 1900 ... 2007. Output occurs by year.
It is necessary to make at the same time grouping by years and within certain age groups, up to 12, 12 - 18, 18 - 21, 21+.
I hope the scheme is clearly outlined. Not the essence of what framework, I need to make the main grouping on the framework of years.
Everything almost works, you just need to add GROUP BY.
VKontakte example 
SELECT DATE_FORMAT(`date_rozdenie`, '%d.%m.%Y') AS `year`, SUM(`activation`) AS `active` FROM `users` WHERE DATE_FORMAT(`date_rozdenie`, '%Y') >= (YEAR(NOW()) - 100) AND DATE_FORMAT(`date_rozdenie`, '%Y') <= (YEAR(NOW()) - 8) GROUP BY DATE_FORMAT(`date_rozdenie`, '%Y') ORDER BY DATE_FORMAT(`date_rozdenie`, '%Y') Output data for this query. Date of birth and how many people are with this age. 