Skip to content

Instantly share code, notes, and snippets.

@kozo
Created December 13, 2010 14:44
Show Gist options
  • Save kozo/739047 to your computer and use it in GitHub Desktop.
Save kozo/739047 to your computer and use it in GitHub Desktop.
SELECT
date_part('year', age('2010-12-1',birthday)),
count(date_part('year', age('2010-12-1',birthday)))
FROM
member
GROUP BY
date_part('year', age('2010-12-1',birthday))
ORDER BY
date_part('year', age('2010-12-1',birthday))
date_part | count
-----------+-------
29 | 1
30 | 4
31 | 2
32 | 11
・・・・
107 | 2
108 | 1
114 | 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment