SELECT
EXTRACT( DAY FROM date) AS day,
EXTRACT( MONTH FROM date) AS month, who, sum ( wsd ) AS total FROM weekly
WHERE season = '08'
AND status = 1
AND who = 'NAME SURNAME'
GROUP BY day, month
day month who total
12 8 NAME SURNAME 18
我每天都会为“谁”列中的每个人获取“wsd”列的总数。如果一个人一天没有记录在表中,我们无法按预期在结果中看到该名称。
但我也想查看这些记录,日期和名称在总列中为“0”。
我怎么能只用mysql呢?