我有这个
SELECT COLUMN1, COLUMN2, COLUMN3
FROM TABLE_A
WHERE NOT COLUMN1 IN (SELECT COLUMN1 FROM TABLE B)
但我需要它来查看2列而不是1.它需要选择行,TABLE_B中没有行将这两个值放在一起。
答案 0 :(得分:1)
Where (NOt Column1 IN (Select ..) Or Not Column2 IN (Select ..))
或
Where NOt Column1 IN (Select ..) And Not Column2 IN (Select ..)
答案 1 :(得分:0)
如果我理解正确的问题,这应该有效:
concMap.compute(keyId, (key, value) -> {
dosmth; ... return key; });
这是假设select COLUMN1, COLUMN2, COLUMN3
from TABLE_A
left outer join TABLE_B
on TABLE_A.COLUMN1 = TABLE_B.COLUMN1
and TABLE_A.COLUMN2 = TABLE_B.COLUMN2
where TABLE_B.COLUMN1 is null
中涉及的列不允许left outer join
值。如果涉及空值则会变得更复杂......