SELECT od.date,od.orderCount
FROM (
SELECT DATE_FORMAT (order_time, '%Y-%m-%d') date,
count(*) orderCount FROM order WHERE order_time > '開始時間' andorder_time < '結(jié)束時間' GROUPBYDATE_FORMAT (order_time, '%Y-%m-%d')
UNION (SELECT0, '2017-03-01')
UNION (SELECT0, '2017-03-02')
UNION (SELECT0, '2017-03-03')
UNION (SELECT0, '2017-03-04') -- 很多個UNION......
) AS od GROUPBY od.date ORDERBY od.date ASC