How do I search for a text pattern in a column with SQL LIKE?
SELECT * FROM data
WHERE customer LIKE 'A%';
Run this query in QueryLocal →
`LIKE` matches text against a pattern where `%` stands for any sequence of characters (including none) and `_` stands for exactly one character. `customer LIKE 'A%'` keeps every row whose customer name starts with the letter A — swap the pattern to `'%smith%'` to find a substring anywhere in the text instead.
A table named data with columns: order_id (integer), customer (text), country (text), category (text), quantity (integer), unit_price (real), order_date (text, YYYY-MM-DD).