MySQL GROUP BY and Fill Empty Rows

前端 未结 2 2044
天命终不由人
天命终不由人 2020-12-01 20:28

I\'m sure this has been answered before, but I can\'t find it in the detail that I need.

For an analytics system I need to be able to group rows and return them on a

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 21:08

    This is typically done in data warehouses by having a date dimension that has a list of all possible dates. You do an OUTER JOIN to the date dimension and COALESCE the null values to 0.

提交回复
热议问题