Like

From SQLZOO
Jump to navigation Jump to search

How do I use LIKE in a sql SELECT statement.

schema:gisq

The LIKE command allows "Wild cards". A % may be used to match and string, _ will match any single character.

The example shows countries begining with Z. The country Zambia matches because ambia matches with the %.

SELECT name FROM bbc
WHERE name LIKE 'Z*'
SELECT name FROM bbc
WHERE name LIKE 'Z%'
DataWars, Data Science Practice Projects - LogoDataWars: Practice Data Science/Analysis with +100 Real Life Projects