LIKE & Wildcards

The LIKE operator filters text by pattern instead of an exact match, using two wildcard characters: % and _.

The % wildcard

% stands in for zero or more of any character. It's the one you'll reach for constantly — for "starts with," "ends with," or "contains":

names starting with A
Result

Flip the % to the front to match the end of a string instead, or put one on both sides to match anywhere inside it:

department contains 'ing'
Result

The _ wildcard

_ matches exactly one character, which is handy when you know the length or shape of what you're looking for:

four-letter names
Result
Note: matching with LIKE is case-insensitive in SQLite for plain ASCII text, but this varies between database systems — MySQL and Postgres each have their own case-sensitivity rules, so it's worth double-checking on whichever database you're actually using.