mysql count by month
select year(order_date),month(order_date),count(*) from sales group by year(order_date),month(order_date) order by year(order_date),month(order_date); +------------------+-------------------+-----------+ | year(order_date) | month(order_date) | count(*) | +------------------+-------------------+-----------+ | 2020 | 1 | 408 | | 2020 | 2 | 320 | | 2020 | 3 | 540 | | ... | ... | ... | +------------------+-------------------+-----------+