我的sql语句
SELECT
WEEKDAY(osr.created_date) AS weekDay,
IF (count(1) IS NULL, 0, count(1)) AS num
FROM osr_work AS osr
INNER JOIN el_user AS el ON el.id = 141
WHERE
osr.teacher_id = 141 AND
YEARWEEK(date_format(osr.created_date,'%Y-%m-%d')) = YEARWEEK(now())
GROUP BY WEEKDAY(osr.created_date);
结果:
0-6:分别代表周一至周日
我希望得到周一至周日所有的数据,因为周一和周五,周六,周日没有数据,就默认num为0;我该如何写,求指导!!!