Select all months within given date span, including the ones with 0 values

前端 未结 2 1621
走了就别回头了
走了就别回头了 2020-11-28 15:13

I\'m trying to write a MySQL query to get an average value per month, for all months between to given dates. My idea is this:

Query, something like

S         


        
2条回答
  •  Happy的楠姐
    2020-11-28 15:54

    The easiest way probably is to create a date table containing months and years and union this with your final result.

提交回复
热议问题