mysql - SQL query to find field value that is contained in supplied string -


is possible make sql query search keyword contained in string.

e.g. string supplied "the quick brown fox" , database contains column 'keywords' , 1 of entries has word 'fox' stored in column. possible search query returns entries contain words within string supplied?

where instr(keywordfield, 'searchstring') > 0 

the above slow, , depending on logic might give false positives; if search string contains "foxy", keywordfield "fox" match.

where keywordfield in ('word1', 'word2', 'etc') 

this work fast , more reliably, you'll have process search string , construct query in code.

(these both mysql specifically, can't imagine ms sql not having similar, if not near identical, functionality.)


Comments

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -