|
Conditions with partial string matching
EXAMPLE DATABASE: WorldDATA INPUTTable organization in the database World.mdb is used as input.
QUERY like_beginwithSELECT * FROM organization WHERE name LIKE "africa*"; Query like_beginwith produces the output below which contains 2 records where the organization name begins with africa. Note that the partial string match is not case sensitive.
QUERY like_endwithSELECT * FROM organization WHERE name LIKE "*africa"; Query like_endwith produces the output below which contains 2 records where the organization name ends with africa. Note that the partial string match is not case sensitive.
QUERY like_embeddedSELECT * FROM organization WHERE name LIKE "*africa*"; Query like_embedded produces the output below which contains 14 records where the organization name contains africa. Note that the partial string match is not case sensitive.
DISCUSSIONThe WHERE condition uses the like operator for the partial string matching. The * is used as a wildcard character that can match any characters. There are possibilities for more complex pattern matching. For more details, see the help page for like operator.
Last modified September 23, 2008 2:55 am
|