LIKE operator allows you to search for a specified pattern in strings. LIKE supports wildcard characters.
Syntax:
-- Pattern matching str [NOT] LIKE pattern [ESCAPE escape_char]
Example:
-- Select cities with the second letter 'a' in the name SELECT * FROM cities WHERE name LIKE '_a%';
Supported in:
Oracle | LIKE | |
SQL Server | LIKE | Non-standard wildcard characters [] and [^] |
Summary:
Alternatives:
Oracle | REGEXP_LIKE | ||
PostgreSQL | REGEXP_LIKE | Since PostgreSQL 15 |