Guides/SQL LIKE
📘
SQL Guide

SQL LIKE

Filter text with simple patterns and wildcards.

What & Why

The LIKE operator is used to filter text columns by a pattern, with % and _ as wildcards. LIKE is useful when a text field has a pattern but not a fixed exact value. Analysts use it for campaign names, email domains, sources, and product labels.

See how it works

Marketing wants campaigns whose names mention LinkedIn.

SELECT
  name,
  channel,
  status
FROM marketing.campaigns
WHERE name LIKE '%LinkedIn%';

Syntax pattern

See explanation
WHERE column_name LIKE '%pattern%'
  • % matches any number of characters.
  • Use a trailing percent for starts-with patterns.
  • ILIKE is the Postgres case-insensitive version.
Now You Try

Practice this concept hands-on

Run SQL against real datasets right here in the browser and get instant AI feedback. Join the waitlist to get access.

Join the waitlist