← All languages
SQL keyword of the day
Random

LIKE

Search for a specified pattern in a column.

Description

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.

Arguments

NameDescriptionOptional
pattern A string pattern using % and _ wildcards to match against column values. No

Example

SELECT * FROM users WHERE name LIKE 'A%';
SELECT * FROM products WHERE code LIKE '__-___';