generate empty rows even if empty between 2 dates

后端 未结 3 1711
不思量自难忘°
不思量自难忘° 2021-01-20 02:01

I have this simple query that fetches all completed orders between 2 dates(about 6 months at a time):

select IFNULL(sum(o.amount), 0) as amount, o.completed_         


        
3条回答
  •  不要未来只要你来
    2021-01-20 02:31

    This query is complicated due to a number of factors.

    The easiest solution might be to add a 0 amount on the first of each month.

提交回复
热议问题