NOT_LIKE
All functions > COMPARISON > NOT_LIKE
Returns TRUE if a string does NOT match a specified pattern with wildcards.
Syntax
NOT_LIKE(expr1, expr2[, escape])
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
string | VARCHAR | Yes | String expression to test |
pattern | VARCHAR | Yes | Pattern string with wildcards (% for any characters, _ for single character) |
escape | VARCHAR | No | Optional escape character to treat wildcards literally |
Returns
BOOLEAN - TRUE if string does not match pattern, FALSE otherwise
Notes
- Opposite of LIKE function
- Uses SQL wildcard pattern matching
%
matches zero or more characters_
matches exactly one character- Case-sensitive matching
- NULL inputs return NULL
- Use ESCAPE clause to treat wildcard characters literally
- Can be used with operator syntax:
string NOT LIKE pattern