Reputation: 73
I want to find a word in a string with SQL. I currently use:
SELECT * FROM dreams
WHERE
title
LIKE '%lo%'
But I want also to find other spellings like "Lo" or "LO" and so on..
Any Ideas ?
Upvotes: 0
Views: 338
Reputation: 1365
We have no idea what version of SQL, but here's a very possibly related post on SOundex, and another on Full Text Searching, a page on CONTAINS.
The more info you provide, the better able we are to help.
I hope that SOUNDEX, or Full Text Searching, or CONTAINS, alternatively, are useful to you.
Upvotes: 0
Reputation: 1933
Convert it to upper case before comparing
SELECT * FROM dreams
WHERE
upper(title)
LIKE '%LO%'
Upvotes: 4
Reputation: 329
SELECT * FROM dreams WHERE title LIKE '%lo%'
union
SELECT * FROM dreams WHERE title LIKE '%LO%'
union
SELECT * FROM dreams WHERE title LIKE '%Lo%';
Upvotes: 0