jcrypt
03-11-2010, 06:06 PM
Is there a wildcard that can be used in combination with LIKE that can be used for spaces, end of line characters or the end of a string?
table1
id(int) title(varchar) description(text)
SELECT * FROM table1 WHERE title LIKE 'example' OR description LIKE 'example'
If I use '%example%' then the results will include entries like 'examples' and 'example1'. I would like to only retrieve exact matches for the keyword where the keyword is separated by a space or the beginning or end of string. Is there a wildcard that I can use for this?
^example
' 'example
\nexample
example$
example' '
example\n
table1
id(int) title(varchar) description(text)
SELECT * FROM table1 WHERE title LIKE 'example' OR description LIKE 'example'
If I use '%example%' then the results will include entries like 'examples' and 'example1'. I would like to only retrieve exact matches for the keyword where the keyword is separated by a space or the beginning or end of string. Is there a wildcard that I can use for this?
^example
' 'example
\nexample
example$
example' '
example\n