MySql Query: include days that have COUNT(id) == 0 but only in the last 30 days
问题 I am doing a query to get the number of builds per day from our database for the last 30 days. But it has become needed to marked days where there were no builds also. In my WHERE clause I use submittime to determine whether there were builds, how could I modify this to include days that have COUNT(id) == 0 but only in the last 30 days. Original Query: SELECT COUNT(id) AS 'Past-Month-Builds', CONCAT(MONTH(submittime), '-', DAY(submittime)) as 'Month-Day' FROM builds WHERE DATE(submittime) >=