Search for a specified pattern in a column.
The LIKE operator is used in a WHERE clause to search for a specified pattern in a column. It supports two wildcard characters: % matches any sequence of zero or more characters, and _ matches exactly one character. LIKE is case-sensitive in some databases and case-insensitive in others. Use NOT LIKE to exclude rows matching a pattern. For more complex pattern matching, some databases offer SIMILAR TO or regular expression functions.
| Name | Description | Optional |
|---|---|---|
pattern |
A string pattern using % and _ wildcards to match against column values. | No |
SELECT * FROM users WHERE name LIKE 'A%';
SELECT * FROM products WHERE code LIKE '__-___';