Possible Duplicate:
MySQL LIKE vs LOCATE
I need to write a Mysql query which chooses rows based on a string in a column. Say the column is named TestColumn. I need to choose all rows which contain ‘stackoverflow’ anywhere in the column. Would it better to use
Select * from testtable where TestColumn like '%stackoverflow%'
or
Select * from testtable where Locate('stackoverflow', TestColumn)>0
Which would result in a better performance? Thanks in advance.
% is better than a function call. % will use full text index if it is existing. It is not the case with the function call.