sql中,or与and 的运算级别

or 优先级 倒数第一 and 优先级 倒数第二 select * from AA where a >1 or b>1 and C>1 等同 select * from AA where a >1 or (b>1 and C>1 ) 因此,用到or和and的时候记住加括号,不然先执行and
相关文章
相关标签/搜索