Schema:
CREATE TABLE #exclGeoKeys (xKEY INT);
INSERT INTO #exclGeoKeys
values
(1),
(2);
CREATE TABLE #y (NAME CHAR(1),xKEY INT);
INSERT INTO #y
values
('A',1),
('C',2),
('D',NULL),
('E',3),
('F',4);
Can I shorten the following so it produces the same result and doesn't need the section OR xKEY IS NULL
?
SELECT *
FROM #y
WHERE xKEY NOT IN
(
SELECT *
FROM #exclGeoKeys
)
OR
xKEY IS NULL;