如果这是一个 n00b 问题,我对 SQL 有点陌生,所以请多多包涵。所以我的代码运行类似于以下内容:
(select "Balance."CodeValue" AS "CodeValue"
, "Balance"."OtherValue" AS "OtherValue"
from "SomeDB"."dbo"."AValue" "Balance"
where ("Balance"."CodeValue" between 'A' and'Z'
or "Balance"."CodeValue" in ('ABCDEFG'))
and "Balance"."CodeValue" NOT in ('XYZ', '1234', 'Etc')
or "Balance"."CodeValue" between 'A' and 'Z') "Balance"
on "SomeMatrix"."CodeValue" = "Balance"."CodeValue"
阅读它,它似乎检查“余额”。“代码值”在 A 和 Z 之间或在 'ABCDEFG' 中,而不是在 'XYZ'、'1234'、'Etc' 或 A 和 Z 之间。不是 A 和 Z 的两个检查相互抵消了吗?
提前感谢您的帮助。