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

更新时间:2019-05-09    来源:thinkphp    手机版     字体:

【www.bbyears.com--thinkphp】

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的优先级,可以加上括号以区分。

 

本文来源:http://www.bbyears.com/jiaocheng/50134.html