您的位置:首页 > 数据库

sql中,or与and 的运算级别

2016-09-06 16:07 211 查看


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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: