sql-逻辑运算符-优先级

来源:互联网 发布:美工刀片哪个牌子好用 编辑:程序博客网 时间:2024/05/21 22:24

and的优先级高于or

select  *  from  table  where  Condition1 and  Condition2 or Condition3  

等价于

select   *   from   table   where   (Condition1   and   Condition2)   or   Condition3  

想要的效果

select   *   from   table   where   Condition1   and   (Condition2   or   Condition3)  

参考站点:

http://blog.csdn.net/eclothy/article/details/48265445