SELECT COUNT(*) AS total FROM table GROUP BY (YEAR_MONTH FROM data) ORDER BY (YEAR_MONTH FROM data) ASC _YEAR_MONTH_ and I don’t know why
By the syntax I believe you’re using mysql. So I believe you’ve forgotten the extract. SELECT COUNT(*) AS total FROM table GROUP BY EXTRACT(YEAR_MONTH FROM data) ORDER BY EXTRACT(YEAR_MONTH FROM data) ASC
This SQL was done in which database? Put the error message to facilitate the identification of the problem.
– Felipe J. R. Vieira
The EXTRACT function is not missing?
EXTRACT(YEAR_MONTH FROM data)
– EmanuelF