在这里过度简化,但我需要帮助。假设我有一个这样的 SQL 语句:
SELECT * FROM Policy p
JOIN OtherPolicyFile o on o.PolicyId = p.PolicyId
WHERE OtherPolicyFile.Status IN (9,10)
好的,故事就讲到这里。我还需要提取 Status = 11 的任何 OtherPolicyFile,但前提是存在状态为 9 或 10 的匹配 OtherPolicyFile。
换句话说,我通常不会拉取状态为 11 的 OtherPolicyFile,但如果该策略也有状态为 9 或 10 的 OtherPolicyFile,那么我还需要拉取状态为 11 的任何 OtherPolicyFiles。
可能有一个非常简单的方法来写这个,但我现在很疲惫,如果不跳过箍,它就不会来找我。任何帮助,将不胜感激。