LIKE

Allows you to use wildcards in the where clause of an SQL statement. This allows pattern matching. The LIKE condition can be used in any valid SQL statement - select, insert, update, or delete. NOT can be used before the LIKE to filter (NOT LIKE).

The patterns that you can choose from are:

% allows you to match any string of any length (including zero length)
_ allows you to match on a single character (can repeat n times to indicate n characters)

Examples using % wildcard

SELECT * FROM suppliers WHERE supplier_name LIKE 'Lanka%'; 
 
SELECT * FROM suppliers WHERE supplier_name LIKE '%Jaya%';

Examples using _ wildcard

SELECT * FROM suppliers WHERE supplier_name LIKE 'Ind_ka';

Leave a Reply

You must be logged in to post a comment.