How to write a query suitable for generating an age pyramid like this:
I have a table with a DATE field containing their birthday and a BOOL field containing the gender (male = 0, female = 1). Either field can be NULL.
I can't seem to work out how to handle the birthdays and put them into groups of 10 years.
EDIT:
Ideally the X axis would be percent rather than thousands :)