Data 360 SQL and Tableau Hyper API
Type Conversions
ALL
ANY and SOME
EXISTS
IN
NOT IN
Logical Operators
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
NOT INApplies to: ✅ Data 360 SQL ✅ Tableau Hyper API
Tests whether an expression differs from every row returned by a subquery. Returns a boolean result.
1<expression> NOT IN ( <subquery> )<expression>: The left-hand value to evaluate and compare against each row of the subquery result.<subquery>: A parenthesized subquery that returns exactly one column.Returns true if only unequal subquery rows are found, including when the subquery returns no rows. Returns false if an equal row is found.
Returns NULL if the left-hand expression is NULL, or if there are no equal right-hand values and at least one right-hand row is NULL.
NOT IN is equivalent to <> ALL.NULL values in your subquery (for example, WHERE column IS NOT NULL). A single NULL can cause the entire expression to return NULL instead of TRUE.Return rows whose value does not appear in the subquery result.
1SELECT col1
2FROM tab1
3WHERE col1 NOT IN (SELECT col2 FROM tab2 WHERE col2 IS NOT NULL);