i want to check if a string contains a field value as a substring or not.
select * from mytable where instr("mystring", column_name);
but this does not search on word boundaries.
select * from mytable where instr("mystring", concat('[[:<:]]',column_name,'[[:>:]]');
does not work either. how to correct this?
You can do this using the
REGEXPoperator:Note, however, that this is slow. You might be best off using the MySQL’s
FULLTEXTsearch feature if you care about words. Or do a normalInStr()check then filter the results.