当前位置:Gxlcms > 数据库问题 > mysql 查询 or and 优先级

mysql 查询 or and 优先级

时间:2021-07-01 10:21:17 帮助过:4人阅读

select * from tableName where a =1 or a = 2 and b like "%%" ;

tips:and 优先级高于 or

 

2.查询二:

查询 条件(a =2 或 a =1 ) 且 (b 包含 “菜”)

1 select * from tableName where (a =1 or a = 2and b like "%%" ;

 

小窍门:

使用mysql连接工具Navicat 双击表选择需要的条件 点击 “应用”,下方会生成对应的sql

技术图片

 

mysql 查询 or and 优先级

标签:weight   font   tab   点击   img   生成   info   like   where   

人气教程排行