NOT_LIKE

All functions > COMPARISON > NOT_LIKE

Returns TRUE if a string does NOT match a specified pattern with wildcards.

Signatures

Returns: TRUE if string does not match pattern, FALSE otherwise

NOT_LIKE(string: VARCHAR, pattern: VARCHAR, [escape: VARCHAR]) → BOOLEAN
sql
ParameterTypeRequiredDescription
stringVARCHARYesString expression to test
patternVARCHARYesPattern string with wildcards (% for any characters, _ for single character)
escapeVARCHARNoOptional escape character to treat wildcards literally

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

See also

Examples

Basic pattern matching

FeatureQL
SELECT
    f1 := 'hello' NOT LIKE 'world',  -- No match
    f2 := 'hello' NOT LIKE 'h%',  -- Does start with 'h'
    f3 := 'hello' NOT LIKE '%o',  -- Does end with 'o'
    f4 := 'hello' NOT LIKE '%ll%',  -- Does contain 'll'
    f5 := 'hello' NOT LIKE 'h_llo',  -- Does match pattern
    f6 := 'hello' NOT LIKE 'HELLO'  -- Case sensitive
;
Result
f1 BOOLEANf2 BOOLEANf3 BOOLEANf4 BOOLEANf5 BOOLEANf6 BOOLEAN
TRUEFALSEFALSEFALSEFALSETRUE

NULL handling

FeatureQL
SELECT
    f1 := NULL::VARCHAR NOT LIKE 'pattern',  -- NULL string
    f2 := 'text' NOT LIKE NULL::VARCHAR  -- NULL pattern
;
Result
f1 BOOLEANf2 BOOLEAN
NULLNULL

File extension filtering

FeatureQL
SELECT
    f1 := 'document.pdf' NOT LIKE '%.txt',  -- Not a text file
    f2 := 'data.csv' NOT LIKE '%.txt'  -- Not a text file
;
Result
f1 BOOLEANf2 BOOLEAN
TRUETRUE

Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19