SELECT
click_date,
count(plan_order_id) num
FROM
(
SELECT
date_sub(curdate(), INTERVAL 1 DAY) AS click_date
UNION ALL
SELECT
date_sub(curdate(), INTERVAL 2 DAY) AS click_date
UNION ALL
SELECT
date_sub(curdate(), INTERVAL 3 DAY) AS click_date
UNION ALL
SELECT
date_sub(curdate(), INTERVAL 4 DAY) AS click_date
) a
LEFT JOIN t_plan_order tpo on tpo.plan_order_date = a.click_date and tpo.is_delete = 0
GROUP BY
a.click_date
结果如下