一聚教程网:一个值得你收藏的教程网站

热门教程

sql语句多个and和or的优先级

时间:2022-06-29 07:58:48 编辑:袖梨 来源:一聚教程网

sql语句:

 代码如下 复制代码
#查询sql语句
select count(sid) as count,TRUNCATE(income/installnum,2) as price from think_info where (TRUNCATE(income/installnum,2)>=0.2 and pay_type=2 and user_type=0) or (user_type=0 and installnum=0)

当sql语句中有很多and和or的时候,要注意and和or的优先级,可以加上括号以区分。

 

热门栏目