目前SQL查询存在问题,如下所示
UPDATE table
SET result = 6
WHERE date between DATE_ADD(curdate(), INTERVAL - 4 DAY)
AND curdate()
AND TEAM1 = 6 OR TEAM2 = 6
在select语句中搜索此日期范围工作正常,当我尝试查看IT TEAM1或TEAM2 = 6时
我使用的数据库是MySql到PhpMyAdmin。
非常感谢任何意见。
答案 0 :(得分:4)
试试这个:
UPDATE table
SET result = 6
WHERE
date BETWEEN DATE_ADD(curdate(), INTERVAL - 4 DAY) AND curdate()
AND
(TEAM1 = 6 OR TEAM2 = 6)