MySQL Query with count and group by
Assuming that your date is an actual datetime column: SELECT MONTH(date), YEAR(date), id_publisher, COUNT(*) FROM raw_occurrence_record GROUP BY MONTH(date), YEAR(date), id_publisher You can concatenate your month & year like so: SELECT CONCAT(MONTH(date), “https://stackoverflow.com/”, YEAR(date)) AS Month, id_publisher, COUNT(*) FROM raw_occurrence_record GROUP BY MONTH(date), YEAR(date), id_publisher To find months where there are no records, you will … Read more