sqlserver中or和and优先级问题
今天发现写的接口有问题,排查到最后发现因为自己忽略了sqlserver中or和and的优先级,导致查询的数据不正确。
关于他们的使用见下面的例子
比如想要查询高三2班2000年出生或者是2002年出生的所有男生,那么sql应该这么写
1 |
|
还有另一种写法,可以用in代替or
1 |
|
sqlserver中or和and优先级问题
http://example.com/2018/07/27/2018-07-27-sqlserver-sqlserver中or和and优先级问题/