title: SQL change "like" to "contains"
body: <pre><code>products table (mySQL)
  
  record_id     categories (comma-delimited list)
  ---------     --------------------------------
  1             960|1,957|1,958|1
  </code></pre>
  
  <p>I have the following dynamic query (simplified for the purposes of this question). The query is passed specified categories, each in the format xxxx|yyyy, and I need to return  products having the passed category in its comma-delimited list of categories. </p>
  
  <p>The current query looks like:</p>
  
  <pre><code>select p.* from products p
  where (p.categories like '%27|0%' or p.categories like '%972|1%' or p.categories like '%969|1%')
  </code></pre>
  
  <p>But, the LIKE clause sometimes permits anomalies.
  I would like to write the query more like:</p>
  
  <pre><code>select p.* from products p 
  where (p.categories contains '27|0' or p.categories contains'972|1' or p.categories contains  '969|1')
  </code></pre>
  
  <p>How would I do this?</p>