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

被折叠的 条评论
为什么被折叠?