SQLite query, 'LIKE'

Lene picture Lene · Sep 27, 2012 · Viewed 49.7k times · Source

I am trying to retrieve information from my database.
I have words like Lim Won Mong and Limited.

If I do my query, SELECT name FROM memberdb WHERE name LIKE '%LIM%', it displays both Lim Won Mong and Limited and I only want data from Lim Won Mong.

How should I rewrite my query?

Answer

jeet picture jeet · Sep 27, 2012

Execute following Query:

select name from memberdb where name like '% LIM %' OR name like "LIM %" OR name like "% LIM" OR name like "LIM"