I want to eliminate rows that have both NULLs in field1 AND field2.We inserted 6 rows, three NULL, NULL rows should not be in my result set.This query does this, but is there an easier way to impliment this??CREATE TABLE #MyTable(Field1 VARCHAR(50), Field2 VARCHAR(50))INSERT INTO #MyTable(Field1, Field2) VALUES (NULL, NULL)INSERT INTO #MyTable(Field1, Field2) VALUES (234345, NULL)INSERT INTO #MyTable(Field1, Field2) VALUES (NULL, 245454324654)INSERT INTO #MyTable(Field1, Field2) VALUES (NULL, NULL)INSERT INTO #MyTable(Field1, Field2) VALUES (564874357, 245454324654)INSERT INTO #MyTable(Field1, Field2) VALUES (NULL, NULL)--I want to eliminate rows that have both NULLs in field1 AND field2.--We inserted 6 rows, three NULL, NULL rows should not be in my result set.--This query does this, but is there an easier way to impliment this??SELECT * FROM #MyTableWHERE (Field1 IS NOT NULL AND Field2 IS NULL) OR (Field1 IS NULL AND Field2 IS NOT NULL) OR (Field1 IS NOT NULL AND Field2 IS NOT NULL)DROP TABLE #MyTable
Thanks!Michael<Yoda>Use the Search page you must. Find the answer you will.</Yoda>