Pattern Matching in SQL
Pattern Matching in SQL
Example
Select all customers that starts with the letter "a":
SELECT * FROM Customers WHERE CustomerName LIKE 'a%';
Example
Return all customers from a city that contains the letter 'L':
Example
Example
Return all customers that starts with 'a' or starts with 'b':
SELECT * FROM Customers WHERE CustomerName LIKE 'a
%' OR CustomerName LIKE 'b%';
Example
Example
Return all customers that starts with "b" and ends with "s":