Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
クエリに問題がある
SELECT IFNULL(SUM(a.x), 0) AS x, IFNULL(COUNT(*), 0) AS num FROM a AS a WHERE (a.`time` >= DATE_SUB(CURDATE(), INTERVAL 7 DAY)) GROUP BY DAY(a.time)
大丈夫ですが、正確な日に記録がない場合、この日はノーリターンです。0 を返す必要があります。どうすればよいですか?