SQL LIKE
Find text patterns with % and _ wildcards.
How it works
LIKE is useful when an exact equality check is too strict. The % wildcard represents any number of characters, while _ represents exactly one character.
Pattern matching is convenient for codes, descriptions and naming conventions, but a leading % can be expensive on very large indexed tables.
Find all submix identifiers containing 'AK' or all materials whose description starts with 'Filter'.
The pattern
SELECT columns
FROM table
WHERE column LIKE 'pattern';Example
SELECT ProductID, ProductName
FROM Products
WHERE ProductName LIKE '%Cable%';Run the example
Edit the query and run it against the built-in demo tables. Nothing is sent to a server.
The learning runner supports SELECT, WHERE, LIKE, IN, BETWEEN, GROUP BY, HAVING, JOIN, aggregates, ORDER BY and LIMIT. Advanced lessons explain additional production SQL concepts even when the mini runner does not execute that syntax.
Which pattern finds values that start with 'PO-'?
Progress is stored only in this browser. No account required.