SELECT ifnull(SUM(duration) ,0)AS totalTimes
FROM
teacher_plan_finish_record
WHERE
userId = 781435
如果第一个参数为null 就显示第二个参数的值。
SELECT ifnull(SUM(duration) ,0)AS totalTimes
FROM
teacher_plan_finish_record
WHERE
userId = 781435
如果第一个参数为null 就显示第二个参数的值。