LIKE multiple

All functions > COMPARISON > LIKE multiple

Case-sensitive or case-insensitive pattern matching: LIKE / ILIKE with ANY, ALL, or NONE and a parenthesized pattern list, plus binary ILIKE / NOT ILIKE on scalars.

Syntax

expr1 (LIKE|ILIKE) (ANY|ALL|NONE) (pat1, pat2, …)  ·  expr1 ILIKE pattern

Function form

LIKE_ANY()

Returns: TRUE, FALSE, or NULL following three-valued logic for NULL inputs or pattern elements

LIKE_ANY(expr1: VARCHAR, patterns: ARRAY(VARCHAR), [escape: VARCHAR]) → BOOLEAN
sql
ParameterTypeRequiredDescription
expr1VARCHARYesString to test
patternsARRAY(VARCHAR)YesWildcard patterns (%, _); same escape rules as LIKE
escapeVARCHARNoEscape character for % / _ in each pattern

LIKE_ALL()

Returns: TRUE, FALSE, or NULL following three-valued logic for NULL inputs or pattern elements

LIKE_ALL(expr1: VARCHAR, patterns: ARRAY(VARCHAR), [escape: VARCHAR]) → BOOLEAN
sql
ParameterTypeRequiredDescription
expr1VARCHARYesString to test
patternsARRAY(VARCHAR)YesWildcard patterns (%, _); same escape rules as LIKE
escapeVARCHARNoEscape character for % / _ in each pattern

LIKE_NONE()

Returns: TRUE, FALSE, or NULL following three-valued logic for NULL inputs or pattern elements

LIKE_NONE(expr1: VARCHAR, patterns: ARRAY(VARCHAR), [escape: VARCHAR]) → BOOLEAN
sql
ParameterTypeRequiredDescription
expr1VARCHARYesString to test
patternsARRAY(VARCHAR)YesWildcard patterns (%, _); same escape rules as LIKE
escapeVARCHARNoEscape character for % / _ in each pattern

ILIKE_ANY()

Returns: TRUE, FALSE, or NULL following three-valued logic for NULL inputs or pattern elements

ILIKE_ANY(expr1: VARCHAR, patterns: ARRAY(VARCHAR), [escape: VARCHAR]) → BOOLEAN
sql
ParameterTypeRequiredDescription
expr1VARCHARYesString to test
patternsARRAY(VARCHAR)YesWildcard patterns (%, _); same escape rules as LIKE
escapeVARCHARNoEscape character for % / _ in each pattern

ILIKE_ALL()

Returns: TRUE, FALSE, or NULL following three-valued logic for NULL inputs or pattern elements

ILIKE_ALL(expr1: VARCHAR, patterns: ARRAY(VARCHAR), [escape: VARCHAR]) → BOOLEAN
sql
ParameterTypeRequiredDescription
expr1VARCHARYesString to test
patternsARRAY(VARCHAR)YesWildcard patterns (%, _); same escape rules as LIKE
escapeVARCHARNoEscape character for % / _ in each pattern

ILIKE_NONE()

Returns: TRUE, FALSE, or NULL following three-valued logic for NULL inputs or pattern elements

ILIKE_NONE(expr1: VARCHAR, patterns: ARRAY(VARCHAR), [escape: VARCHAR]) → BOOLEAN
sql
ParameterTypeRequiredDescription
expr1VARCHARYesString to test
patternsARRAY(VARCHAR)YesWildcard patterns (%, _); same escape rules as LIKE
escapeVARCHARNoEscape character for % / _ in each pattern

ILIKE()

Returns: TRUE, FALSE, or NULL

ILIKE(expr1: VARCHAR, expr2: VARCHAR, [escape: VARCHAR]) → BOOLEAN
sql
ParameterTypeRequiredDescription
expr1VARCHARYesString to match
expr2VARCHARYesPattern
escapeVARCHARNoEscape character

NOT_ILIKE()

Returns: TRUE, FALSE, or NULL

NOT_ILIKE(expr1: VARCHAR, expr2: VARCHAR, [escape: VARCHAR]) → BOOLEAN
sql
ParameterTypeRequiredDescription
expr1VARCHARYesString to match
expr2VARCHARYesPattern
escapeVARCHARNoEscape character

Notes

  • Scalar ILIKE / NOT ILIKE: same % and _ wildcards as LIKE; case folding follows the backing engine / dialect (e.g. Trino compares lowercased VARCHARs).
  • Quantifiers ANY / ALL / NONE: keyword syntax is LIKE ANY (pat1, pat2, …) or ILIKE ALL (…); patterns are still typed as ARRAY(VARCHAR). Callable forms use LIKE_* / ILIKE_* with an ARRAY argument.
  • Predicate spellings such as NOT … LIKE ANY … are registered as internal names (NOT_LIKE_ANY, …) for translation only — they do not get standalone documentation pages.
  • Scalar case-sensitive LIKE without ANY/ALL/NONE stays on the dedicated LIKE / NOT LIKE operator pages.

Examples

LIKE

FeatureQL
RETURN
    -- Starts with 'h'
    f1 := 'hello' LIKE 'h%',
    -- Case-sensitive
    f2 := 'hello' LIKE 'HELLO'
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

LIKE ANY

FeatureQL
RETURN
    -- Matches one of the patterns (LIKE is case-sensitive)
    f1 := 'hello' LIKE ANY ('%el%', '%lo'),
    -- No pattern matches
    f2 := 'hello' LIKE ANY ('z%')
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

LIKE ALL

FeatureQL
RETURN
    -- Both patterns match
    f1 := 'hello' LIKE ALL ('%e%', '%o'),
    -- One pattern fails
    f2 := 'hello' LIKE ALL ('%e%', '%z')
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

LIKE NONE

FeatureQL
RETURN
    -- No pattern matches
    f1 := 'hello' LIKE NONE ('%z%', '%q%'),
    -- A pattern matches
    f2 := 'hello' LIKE NONE ('%ell%')
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

ILIKE

FeatureQL
RETURN
    -- Prefix, case-insensitive
    f1 := 'Hello' ILIKE 'h%',
    -- Suffix
    f2 := 'Hello' ILIKE '%O'
;
Result
f1 BOOLEANf2 BOOLEAN
truetrue

ILIKE ANY

FeatureQL
RETURN
    -- Case-insensitive any match
    f1 := 'Hello' ILIKE ANY ('%el%', '%lo')
;
Result
f1 BOOLEAN
true

ILIKE ALL

FeatureQL
RETURN
    -- Both patterns match ignoring case
    f1 := 'Hello' ILIKE ALL ('%e%', '%o')
;
Result
f1 BOOLEAN
true

ILIKE NONE

FeatureQL
RETURN
    -- No case-insensitive match
    f1 := 'Hello' ILIKE NONE ('%z%')
;
Result
f1 BOOLEAN
true

NOT LIKE

FeatureQL
RETURN
    -- No match
    f1 := 'hello' NOT LIKE 'world',
    -- Does match prefix
    f2 := 'hello' NOT LIKE 'h%'
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

NOT ILIKE

FeatureQL
RETURN
    -- No match
    f1 := 'Hello' NOT ILIKE 'z%'
;
Result
f1 BOOLEAN
true

LIKE_ANY — functional call

FeatureQL
RETURN
    -- `LIKE_ANY(expr, patterns)` matches keyword `LIKE ANY`
    f1 := LIKE_ANY('hello', ARRAY('%el%', '%lo'))
;
Result
f1 BOOLEAN
true

LIKE_ANY — chained

FeatureQL
RETURN
    -- Receiver is the string; argument is the pattern array
    f1 := ('hello').LIKE_ANY(ARRAY('%el%', '%lo'))
;
Result
f1 BOOLEAN
true

LIKE_ALL — functional call

FeatureQL
RETURN
    -- `LIKE_ALL(expr, patterns)` matches keyword `LIKE ALL`
    f1 := LIKE_ALL('hello', ARRAY('%e%', '%o'))
;
Result
f1 BOOLEAN
true

LIKE_ALL — chained

FeatureQL
RETURN
    -- Receiver is the string; argument is the pattern array
    f1 := ('hello').LIKE_ALL(ARRAY('%e%', '%o'))
;
Result
f1 BOOLEAN
true

LIKE_NONE — functional call

FeatureQL
RETURN
    -- `LIKE_NONE(expr, patterns)` matches keyword `LIKE NONE`
    f1 := LIKE_NONE('hello', ARRAY('%z%', '%q%'))
;
Result
f1 BOOLEAN
true

LIKE_NONE — chained

FeatureQL
RETURN
    -- Receiver is the string; argument is the pattern array
    f1 := ('hello').LIKE_NONE(ARRAY('%z%', '%q%'))
;
Result
f1 BOOLEAN
true

ILIKE_ANY — functional call

FeatureQL
RETURN
    -- `ILIKE_ANY(expr, patterns)` matches keyword `ILIKE ANY`
    f1 := ILIKE_ANY('Hello', ARRAY('%xx%', '%ll%'))
;
Result
f1 BOOLEAN
true

ILIKE_ANY — chained

FeatureQL
RETURN
    -- Receiver is the string; argument is the pattern array
    f1 := ('Hello').ILIKE_ANY(ARRAY('%xx%', '%ll%'))
;
Result
f1 BOOLEAN
true

ILIKE_ALL — functional call

FeatureQL
RETURN
    -- `ILIKE_ALL(expr, patterns)` matches keyword `ILIKE ALL`
    f1 := ILIKE_ALL('Hello', ARRAY('%e%', '%o'))
;
Result
f1 BOOLEAN
true

ILIKE_ALL — chained

FeatureQL
RETURN
    -- Receiver is the string; argument is the pattern array
    f1 := ('Hello').ILIKE_ALL(ARRAY('%e%', '%o'))
;
Result
f1 BOOLEAN
true

ILIKE_NONE — functional call

FeatureQL
RETURN
    -- `ILIKE_NONE(expr, patterns)` matches keyword `ILIKE NONE`
    f1 := ILIKE_NONE('Hello', ARRAY('%z%'))
;
Result
f1 BOOLEAN
true

ILIKE_NONE — chained

FeatureQL
RETURN
    -- Receiver is the string; argument is the pattern array
    f1 := ('Hello').ILIKE_NONE(ARRAY('%z%'))
;
Result
f1 BOOLEAN
true

ILIKE — functional call

FeatureQL
RETURN
    -- `ILIKE(expr, pattern)` matches keyword `ILIKE`
    f1 := ILIKE('Ab', 'a%')
;
Result
f1 BOOLEAN
true

ILIKE — chained

FeatureQL
RETURN
    -- Receiver is the string; argument is the pattern
    f1 := ('Ab').ILIKE('a%')
;
Result
f1 BOOLEAN
true

NOT_ILIKE — functional call

FeatureQL
RETURN
    -- `NOT_ILIKE(expr, pattern)` matches keyword `NOT ILIKE`
    f1 := NOT_ILIKE('Ab', 'z%')
;
Result
f1 BOOLEAN
true

NOT_ILIKE — chained

FeatureQL
RETURN
    -- Receiver is the string; argument is the pattern
    f1 := ('Ab').NOT_ILIKE('z%')
;
Result
f1 BOOLEAN
true