How to Use LIKE and LIKE ANY in BigQuery
Last updated August 23, 2026 · By the SaturnSQL team
LIKE matches one pattern using % and _. LIKE ANY accepts a list of patterns, replacing a chain of ORs with a single predicate.
% matches any number of characters and _ matches exactly one. Both are case sensitive, so lower the column when you want a case-insensitive match. To match a literal % or _, escape it with a backslash in a raw string.
SELECT * FROM users
WHERE LOWER(email) LIKE '%@example.com';Several patterns in one predicate
The quantified form takes a list and matches if any pattern in it matches, which collapses a long OR chain. NOT LIKE ANY negates the whole thing, and LIKE ALL requires every pattern to match.
SELECT * FROM pages
WHERE path LIKE ANY ('/blog/%', '/learn/%', '/help/%');When to use regex instead
LIKE has only the two wildcards, so anchors, character classes, alternation and repetition are out of reach. REGEXP_CONTAINS covers those and is the better tool once a pattern needs more than a prefix or suffix test. For a plain substring test with no pattern at all, STRPOS or the CONTAINS_SUBSTR function is cheaper than either.
SELECT * FROM pages
WHERE REGEXP_CONTAINS(path, r'^/(blog|learn|help)/');Run this in SaturnSQL
SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.
Try it free