Like

From SQLZOO
Revision as of 14:08, 12 July 2012 by Marek (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, 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%'
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense