我想把这些结合起来
SELECT * FROM Data WHERE date >= NOW() - INTERVAL 1 DAY SELECT * FROM Data WHERE id%5 = 0
应该是这样的
select * from data where id%5 = 0 but if NOW() - INTERVAL 1 DAY select *
k7fdbhmy1#
你需要把这两个条件结合起来 OR ,例如:我要所有的行匹配 cond1 或所有行匹配 cond2 ```SELECT * FROM Data WHERE date >= NOW() - INTERVAL 1 DAY OR id%5 = 0
OR
cond1
cond2
1条答案
按热度按时间k7fdbhmy1#
你需要把这两个条件结合起来
OR
,例如:我要所有的行匹配
cond1
或所有行匹配cond2
```SELECT * FROM Data WHERE date >= NOW() - INTERVAL 1 DAY OR id%5 = 0