SQL functions and statements
LIKE operators now support the keywords ANY and ALL, which let you specify multiple patterns to test against a string expression.
LIKE support for ANY/ALL
LIKE operators now support the keywords ANY and ALL, which let you specify multiple patterns to test against a string expression. For example, the following query qualifies the case-insensitive ILIKE with ALL to find all customer names that contain the strings media
and ever
:
=> SELECT DISTINCT (customer_name) FROM customer_dimension
WHERE customer_name ILIKE ALL ('%media%','%ever%') ORDER BY customer_name;
customer_name
---------------
Evermedia
(1 row)
For details, see LIKE ANY/ALL Usage.