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 ?
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 ?
Convert it to upper case before comparing
SELECT * FROM dreams
WHERE
upper(title)
LIKE '%LO%'
SELECT * FROM dreams WHERE title LIKE '%lo%'
union
SELECT * FROM dreams WHERE title LIKE '%LO%'
union
SELECT * FROM dreams WHERE title LIKE '%Lo%';
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.