How to use the LIKE operator

The syntax of the WHERE clause with the LIKE operator

      WHERE match_expression [NOT] LIKE pattern
      

Wildcard symbols

Symbol Description
% Matches any string of zero or more characters.
_ Matches any single character.

WHERE clauses that use the LIKE operator

Example Results that match the mask
WHERE productName LIKE 'Fender%' All rows that have a name that starts with "Fender". For example, "Fender Stratocaster" and "Fender Precision".
WHERE productName LIKE '%cast%'
WHERE zipCode LIKE '076__' All rows that have a zip code that begins with 076, followed by any two characters. For example, "07652" and "07677", but not 07652-4455.
WHERE orderDate LIKE '2017-06-__%' All rows that have an order date in June of 2017.
2nd 2 rows image

Description

Back