sql中,or与and 的运算级别是不是一样的?

sql中,or与and 的运算级别是不是一样的?


qq_遁去的一_1
浏览 532回答 1
1回答

森栏

不一样,and优先级比or高。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 )如果你只想a>1和c>1建立或关系,则需要写为:select * from AA where(a>1 or b>1 )and C>1
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

SQL Server