LIKE
Pattern-matching conditions
Description
The LIKE operator compares a string expression, such as a column name, with a pattern that uses the wildcard characters % (percent) and _ (underscore). LIKE pattern matching always covers the entire string. To match a sequence anywhere within a string, the pattern must start and end with a percent sign. (Redshift SQL Language reference LIKE).
This grammar is fully supported in Snowflake.
Grammar Syntax
Sample Source Patterns
Setup data
Like
Input Code:
IN -> Redshift_01.sql
Output Code:
OUT -> Redshift_01.sql
Not like
Input Code:
IN -> Redshift_02.sql
Output Code:
OUT -> Redshift_02.sql
Escape characters
Input Code:
IN -> Redshift_03.sql
Output Code:
OUT -> Redshift_03.sql
ILike
Input Code:
IN -> Redshift_04.sql
Output Code:
OUT -> Redshift_04.sql
Operators
The following operators are translated as follows:
Redshift
Snowflake
~~
LIKE
!~~
NOT LIKE
~~*
ILIKE
!~~*
NOT ILIKE
Input Code:
IN -> Redshift_05.sql
Output Code:
OUT -> Redshift_05.sql
Known Issues
Related EWIs
There are no known issues.
Last updated