I have this MySQL query that makes use of MONTH() and YEAR():
SELECT
MONTH(created_at) AS month,
YEAR(created_at) AS year
FROM users
GROUP BY MONTH(created_at), YEAR(created_at)
ORDER BY YEAR(created_at), MONTH(created_at)
How would I modify that query to work with PostgreSQL?
Here is the up-to-date manual
http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT
Btw: This is standard (ANSI) SQL that works on MySQL as well.