Comparison Condition

Conditions

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Description

Comparison conditions state logical relationships between two values. All comparison conditions are binary operators with a Boolean return type.

(RedShift SQL Language Reference Comparison Condition)

Grammar Syntax

Redshift supports the comparison operators described in the following table:

Operator
Syntax
Description

<

a < b

Value a is less than value b.

>

a > b

Value a is greater than value b.

<=

a <= b

Value a is less than or equal to value b.

>=

a >= b

Value a is greater than or equal to value b.

=

a = b

Value a is equal to value b.

<> | !=

a <> b | a != b

Value a is not equal to value b.

ANY | SOME

a = ANY(subquery)

Value a is equal to any value returned by the subquery.

ALL

a <> ALL or != ALL (subquery)

Value a is not equal to any value returned by the subquery.

IS TRUE | FALSE | UNKNOWN

a IS TRUE

Value a is Boolean TRUE.

Use of comparison operators on Strings

It is important to note that in Redshift, comparison operators on strings ignore trailing blank spaces. To replicate this behavior in Snowflake, the transformation applies the RTRIM function to remove trailing spaces, ensuring equivalent functionality. For more information: Significance of trailing blanks

Conversion Table

Most of the operators are directly supported by Snowflake; however, the following operators require transformation:

Redshift
Snowflake
Comments

(expression) IS TRUE

expression

Condition is TRUE.

(expression) IS FALSE

NOT (expression)

Condition is FALSE.

(expression) IS UNKNOWN

expression IS NULL

Expression evaluates to NULL (same as UNKNOWN).

Sample Source Patterns

Input Code:

Output Code:

Known Issues

No issues were found.

There are no known issues.

Last updated