我会尽力解释我的问题:
SELECT ISSUE, COLUMN_B, COLUMN_C, COLUMN_D, COLUMN_E, SECONDARY_ISSUE
FROM
TABLE_A
WHERE
ISSUE NOT LIKE 'VALUE_1'
AND ISSUE NOT LIKE 'VALUE_2'
AND ISSUE NOT LIKE 'VALUE_3'
AND COLUMN_E IS NOT NULL
在[SECONDARY_ISSUE]列下,当前有两个不同的值和NULL值。我需要添加到我的WHERE标准来过滤掉一个或多个[SECONDARY_ISSUE]值,但是在报告结果中显示其他值和NULL。 [ISSUE_CODE]始终为NOT NULL。
我尝试在声明中添加以下内容:
AND SECONDARY_CODE NOT IN (SELECT SECONDARY_ISSUE FROM TABLE_A WHERE SECONDARY_ISSUE='VALUE_A')
然而,这导致数据只显示[SECONDARY_ISSUE ='VALUE_B']而没有NULL结果。涉及[ISSUE_CODE]的许多行都有NULL [SECONDARY_ISSUE]个字段,我需要这些字段出现在结果中。
答案 0 :(得分:0)
尝试将以下语句添加到WHERE子句的末尾:
{{1}}