当 select * from table where a and 条件 b OR 条件 c 的时候
需要将 or 条件用括号括起来再用 and 连接 如下
select * from table where 条件 a and (条件 b OR 条件 c);
Mysql中的 and 与or 优先级别
最新推荐文章于 2024-05-23 15:01:19 发布
当 select * from table where a and 条件 b OR 条件 c 的时候
需要将 or 条件用括号括起来再用 and 连接 如下
select * from table where 条件 a and (条件 b OR 条件 c);