I want to write a query that returns all non-empty cells in column X AND whose values are not 2, 5, OR 8. Am I doing this right? Because my results sure look wrong.
SELECT *
FROM [Example].[dbo].[table]
WHERE X <> '' AND (X <> '2' OR X <> '5' OR X <> '8');
by empty, you mean
NULL(nothing) andempty stringis not equal tonullso you should use special condition to filter out non-NULLvalues usingIS NOT NULL