title: Which is better? Locate or like % in the where clause of a Mysql query
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7499438/mysql-like-vs-locate">MySQL LIKE vs LOCATE</a>  </p>
  </blockquote>
  
  
  
  <p>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</p>
  
  <pre><code>Select * from testtable where TestColumn like '%stackoverflow%'
  </code></pre>
  
  <p>or</p>
  
  <pre><code>Select * from testtable where Locate('stackoverflow', TestColumn)&gt;0
  </code></pre>
  
  <p>Which would result in a better performance? Thanks in advance.</p>