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!
ALLApplies to: ✅ Data 360 SQL ✅ Tableau Hyper API
Tests whether a comparison between an expression and every row of a subquery is true. Returns a boolean result.
1<expression> <operator> ALL ( <subquery> )<expression>: The left-hand value to evaluate and compare against each row of the subquery result.<operator>: A comparison operator that returns a boolean result that’s applied between the left-hand expression and each subquery row.<subquery>: A parenthesized subquery that returns exactly one column.Returns true if every subquery row yields true, including when the subquery returns no rows. Returns false if any comparison yields false.
Returns NULL if no comparison with a subquery row returns false and at least one comparison returns NULL.
NOT IN is equivalent to <> ALL.NULL values in your subquery (for example, WHERE column IS NOT NULL) when using ALL or NOT IN. A single NULL can cause the entire expression to return NULL instead of TRUE.Return rows whose value is greater than every value in the subquery result.
1SELECT col1
2FROM tab1
3WHERE col1 > ALL (SELECT col2 FROM tab2 WHERE col2 IS NOT NULL);When the subquery returns no rows, ALL returns true because every row (of which there are none) trivially satisfies the comparison.
1SELECT 1 = ALL (SELECT col2 FROM tab2 WHERE 1 = 0) AS result;Returns true.
ALL array form that doesn’t involve a subquery.