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 Syntax Railroad diagram
expr1 (LIKE|ILIKE) (ANY|ALL|NONE) (pat1, pat2, …) · expr1 ILIKE pattern 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
Parameter Type Required Description expr1VARCHARYes String to test patternsARRAY(VARCHAR)Yes Wildcard patterns (%, _); same escape rules as LIKE escapeVARCHARNo Escape 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
Parameter Type Required Description expr1VARCHARYes String to test patternsARRAY(VARCHAR)Yes Wildcard patterns (%, _); same escape rules as LIKE escapeVARCHARNo Escape 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
Parameter Type Required Description expr1VARCHARYes String to test patternsARRAY(VARCHAR)Yes Wildcard patterns (%, _); same escape rules as LIKE escapeVARCHARNo Escape 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
Parameter Type Required Description expr1VARCHARYes String to test patternsARRAY(VARCHAR)Yes Wildcard patterns (%, _); same escape rules as LIKE escapeVARCHARNo Escape 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
Parameter Type Required Description expr1VARCHARYes String to test patternsARRAY(VARCHAR)Yes Wildcard patterns (%, _); same escape rules as LIKE escapeVARCHARNo Escape 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
Parameter Type Required Description expr1VARCHARYes String to test patternsARRAY(VARCHAR)Yes Wildcard patterns (%, _); same escape rules as LIKE escapeVARCHARNo Escape character for % / _ in each pattern
ILIKE() Returns: TRUE, FALSE, or NULL
ILIKE(expr1: VARCHAR , expr2: VARCHAR , [escape: VARCHAR]) → BOOLEAN sql
Parameter Type Required Description expr1VARCHARYes String to match expr2VARCHARYes Pattern escapeVARCHARNo Escape character
NOT_ILIKE() Returns: TRUE, FALSE, or NULL
NOT_ILIKE(expr1: VARCHAR , expr2: VARCHAR , [escape: VARCHAR]) → BOOLEAN sql
Parameter Type Required Description expr1VARCHARYes String to match expr2VARCHARYes Pattern escapeVARCHARNo Escape 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 BOOLEAN f2 BOOLEAN true false
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 BOOLEAN f2 BOOLEAN true false
LIKE ALL
FeatureQL
RETURN
-- Both patterns match
f1 := 'hello' LIKE ALL ('%e%', '%o'),
-- One pattern fails
f2 := 'hello' LIKE ALL ('%e%', '%z')
; Result
f1 BOOLEAN f2 BOOLEAN true false
LIKE NONE
FeatureQL
RETURN
-- No pattern matches
f1 := 'hello' LIKE NONE ('%z%', '%q%'),
-- A pattern matches
f2 := 'hello' LIKE NONE ('%ell%')
; Result
f1 BOOLEAN f2 BOOLEAN true false
ILIKE
FeatureQL
RETURN
-- Prefix, case-insensitive
f1 := 'Hello' ILIKE 'h%',
-- Suffix
f2 := 'Hello' ILIKE '%O'
; Result
f1 BOOLEAN f2 BOOLEAN true true
ILIKE ANY
FeatureQL
RETURN
-- Case-insensitive any match
f1 := 'Hello' ILIKE ANY ('%el%', '%lo')
;
ILIKE ALL
FeatureQL
RETURN
-- Both patterns match ignoring case
f1 := 'Hello' ILIKE ALL ('%e%', '%o')
;
ILIKE NONE
FeatureQL
RETURN
-- No case-insensitive match
f1 := 'Hello' ILIKE NONE ('%z%')
;
NOT LIKE
FeatureQL
RETURN
-- No match
f1 := 'hello' NOT LIKE 'world',
-- Does match prefix
f2 := 'hello' NOT LIKE 'h%'
; Result
f1 BOOLEAN f2 BOOLEAN true false
NOT ILIKE
FeatureQL
RETURN
-- No match
f1 := 'Hello' NOT ILIKE 'z%'
;
LIKE_ANY — functional call
FeatureQL
RETURN
-- `LIKE_ANY(expr, patterns)` matches keyword `LIKE ANY`
f1 := LIKE_ANY('hello', ARRAY('%el%', '%lo'))
;
LIKE_ANY — chained
FeatureQL
RETURN
-- Receiver is the string; argument is the pattern array
f1 := ('hello').LIKE_ANY(ARRAY('%el%', '%lo'))
;
LIKE_ALL — functional call
FeatureQL
RETURN
-- `LIKE_ALL(expr, patterns)` matches keyword `LIKE ALL`
f1 := LIKE_ALL('hello', ARRAY('%e%', '%o'))
;
LIKE_ALL — chained
FeatureQL
RETURN
-- Receiver is the string; argument is the pattern array
f1 := ('hello').LIKE_ALL(ARRAY('%e%', '%o'))
;
LIKE_NONE — functional call
FeatureQL
RETURN
-- `LIKE_NONE(expr, patterns)` matches keyword `LIKE NONE`
f1 := LIKE_NONE('hello', ARRAY('%z%', '%q%'))
;
LIKE_NONE — chained
FeatureQL
RETURN
-- Receiver is the string; argument is the pattern array
f1 := ('hello').LIKE_NONE(ARRAY('%z%', '%q%'))
;
ILIKE_ANY — functional call
FeatureQL
RETURN
-- `ILIKE_ANY(expr, patterns)` matches keyword `ILIKE ANY`
f1 := ILIKE_ANY('Hello', ARRAY('%xx%', '%ll%'))
;
ILIKE_ANY — chained
FeatureQL
RETURN
-- Receiver is the string; argument is the pattern array
f1 := ('Hello').ILIKE_ANY(ARRAY('%xx%', '%ll%'))
;
ILIKE_ALL — functional call
FeatureQL
RETURN
-- `ILIKE_ALL(expr, patterns)` matches keyword `ILIKE ALL`
f1 := ILIKE_ALL('Hello', ARRAY('%e%', '%o'))
;
ILIKE_ALL — chained
FeatureQL
RETURN
-- Receiver is the string; argument is the pattern array
f1 := ('Hello').ILIKE_ALL(ARRAY('%e%', '%o'))
;
ILIKE_NONE — functional call
FeatureQL
RETURN
-- `ILIKE_NONE(expr, patterns)` matches keyword `ILIKE NONE`
f1 := ILIKE_NONE('Hello', ARRAY('%z%'))
;
ILIKE_NONE — chained
FeatureQL
RETURN
-- Receiver is the string; argument is the pattern array
f1 := ('Hello').ILIKE_NONE(ARRAY('%z%'))
;
ILIKE — functional call
FeatureQL
RETURN
-- `ILIKE(expr, pattern)` matches keyword `ILIKE`
f1 := ILIKE('Ab', 'a%')
;
ILIKE — chained
FeatureQL
RETURN
-- Receiver is the string; argument is the pattern
f1 := ('Ab').ILIKE('a%')
;
NOT_ILIKE — functional call
FeatureQL
RETURN
-- `NOT_ILIKE(expr, pattern)` matches keyword `NOT ILIKE`
f1 := NOT_ILIKE('Ab', 'z%')
;
NOT_ILIKE — chained
FeatureQL
RETURN
-- Receiver is the string; argument is the pattern
f1 := ('Ab').NOT_ILIKE('z%')
;