Full text search

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

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Full text search with SQL? such as i want to find a specific word in any colum of the table

schema:gisq

The "brute force" method is to use use the LIKE operator against any of the fields to be searched. This will be relatively expensive - but probably good enough in many cases. The term to search for should be quoted and placed within two wild cards.

You should construct the string literal in some scripting language - don't forget to quote it.

 
 
SELECT name FROM bbc
WHERE LOWER(name) LIKE '%the%'
SELECT name FROM bbc
WHERE name LIKE '%the%'
SELECT name FROM bbc
WHERE name LIKE '%the%'
SELECT name FROM bbc
WHERE name LIKE '%the%'
SELECT name FROM bbc
WHERE name LIKE '%the%'
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense