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.
目前有一个SQL查询问题,如下
UPDATE table SET result = 6 WHERE date between DATE_ADD(curdate(), INTERVAL - 4 DAY) AND curdate() AND TEAM1 = 6 OR TEAM2 = 6
在选择语句中搜索此日期范围可以正常工作,当我尝试查看 TEAM1 或 TEAM2 = 6 时
我使用的数据库是通过 PhpMyAdmin 的 MySql。
任何输入将不胜感激。
尝试这个:
UPDATE table SET result = 6 WHERE date BETWEEN DATE_ADD(curdate(), INTERVAL - 4 DAY) AND curdate() AND (TEAM1 = 6 OR TEAM2 = 6)