SELECT extract(MONTH from created_at) AS month, extract(YEAR from created_at) AS year FROM users GROUP BY extract(MONTH from created_at), extract(YEAR from created_at) ORDER BY extract(MONTH from created_at), extract(YEAR from created_at)
最新のマニュアルは次のとおりです
ところで:これはMySQLでも機能する標準(ANSI)SQLです。