The
like
operator allows you to check if a value matches a pattern. It can
be used with the operator not
to check if a value does not match the
pattern specified. The expression is structured as
follows:value like pattern
You can use the following wildcards in the pattern:
Symbol | Description | Example |
---|---|---|
% |
Matches zero or more characters. | Pattern: "bl%"
|
_ |
Matches a single character. | Pattern: "h_t"
|
[] |
Matches any single character within the brackets. | Pattern: "b[ae]t"
|
[start-end] |
Matches any single character within the specified range. | Pattern: "[b-d]at"
|
[^characters] |
Matches any character not in the brackets. | Pattern: "h[^oa]t"
|
Examples
Clause | Result |
---|---|
|
Returns any element where the value of name starts with
a . |
|
Returns any element where the value of name ends with
a . |
|
Returns any element where the value of name contains
bir . |
|
Returns any element where the second character of the value of
name is r . |
|
Returns any element where value of name starts with
a , followed by at least two characters. |
|
Returns any element where value of name starts with
a and ends with o . |
|
Returns any element where value of name does not end with a
capital letter. |
|
Returns any element where value of name only contains
numbers. |