我正在调试一些代码并遇到了这个问题。根据SQL Server的命令,有人可以通过在这个语句周围添加parens来帮助我。它只是我,还是这个糟糕的编码?
WHERE
T1.C1 = @VAR1 AND T1.C2 = @VAR2 AND T1.C3 NOT IN(@VAR3)
OR T2.C1 = @VAR2 OR T3.C1 = @VAR2
答案 0 :(得分:5)
原样,它将被解析为
WHERE
(T1.C1 = @VAR1 AND T1.C2 = @VAR2 AND T1.C3 NOT IN(@VAR3))
OR
(T2.C1 = @VAR2)
OR
(T3.C1 = @VAR2)