ANY Predicate
This is a work in progress, changes may be applied in the future.
Description
In Teradata enables quantification in a comparison operation or IN/NOT IN predicate. The comparison of expression and at least one value in the set of values returned by subquery is true. Please review the following Teradata documentation for more information.
Teradata syntax
{ expression quantifier ( literal [ {, | OR} ... ] ) |
{ expression | ( expression [,...] ) } quantifier ( subquery )
}Where quantifier:
{ comparison_operator [ NOT ] IN } { ALL |ANY | SOME }Snowflake syntax
In subquery form, IN is equivalent to = ANY and NOT IN is equivalent to <> ALL. Review the following Snowflake documentation for more infromation.
To compare individual values:
To compare row constructors (parenthesized lists of values):
To compare a value to the values returned by a subquery:
Sample Source Patterns
Sample data
Teradata
Snowflake
Equal ANY pedicate in WHERE clause
Teradata
100
500
100
300
Snowflake
100
500
100
300
Other comparison operators in WHERE clause
When there are other comparison operators, there equivalent translation is to add a subquery with the required logic.
Teradata
Eve
100
Alice
100
David
200
Bob
300
Snowflake
Alice
100
Eve
100
Bob
300
David
200
IN ANY in WHERE clause
Teradata
100
500
100
300
Snowflake
100
500
100
300
NOT IN ALL in WHERE clause
Teradata
Charlie
500
Bob
300
Snowflake
Charlie
500
Bob
300
Known Issues
NOT IN ANY in WHERE clause
Teradata
Eve
100
Charlie
500
Alice
100
David
200
Bob
300
Snowflake
Eve
100
Charlie
500
Alice
100
David
200
Bob
300
Related EWIs
No related EWIs.
Last updated
