Mysql
 sql >> Database >  >> RDS >> Mysql

Conta i totali per anno e mese

Prova questo:

SELECT DATE_FORMAT(created, '%Y') as 'year',
DATE_FORMAT(created, '%m') as 'month',
COUNT(id) as 'total'
FROM table_name
GROUP BY DATE_FORMAT(created, '%Y%m')