What are the Query Operators supported by Snowflake

Snowflake supports most of the standard operators defined in SQL:1999.

Arithmetic Operators
+ , – , * , / , %

+ (unary) +a Returns a, which will cause implicit conversion of a to a numeric value. If a is a string, but the string cannot be converted to a numeric value, an error is returned.
+ a + b Adds two numeric expressions (a and b).
– (unary) -a Negates the input numeric expression.
a – b Subtracts one numeric expression (b) from another (a).
a – b Subtracts one date expression (b) from another (a). The result is an integer number of days. Subtraction is the only arithmetic operation allowed on DATE expressions.
* a * b Multiplies two numeric expressions (a and b).
/ a / b Divides one numeric expression (a) by another (b).
% a % b Computes the modulo of numeric expression a per b. See also MOD.

Comparison Operators
= , != , <> , < , <= , > , >=

= a = b a is equal to b.
!= a != b a is not equal to b.
<> a <> b a is not equal to b.
> a > b a is greater than b.
>= a >= b a is greater than or equal to b.
< a < b a is less than b.
<= a <= b a is less than or equal to b

Logical/Boolean Operators
AND , NOT , OR

AND a AND b Matches both expressions (a and b).
NOT NOT a Does not match the expression.
OR a OR b Matches either expression.

Set Operators
INTERSECT, MINUS, EXCEPT, UNION

Subquery Operators
[NOT] EXISTS, ANY / ALL, [NOT] IN

Author: user

Leave a Reply

Your email address will not be published. Required fields are marked *