title: SQL trouble with JOIN on INSTR()
body: <p>I've read lots of examples of JOIN syntax, but none of them work for my problem.</p>
  
  <p>I have a table of <strong>quotes</strong> and a table of sales <strong>enquiries</strong>.  One quote may result in multiple enquiries, or it may not result in any enquiries.  I want to create a list of all quotes and include details of any resulting enquiry.  I'm expecting multiple result rows for a quote that resulted in many enquiries.  I'm expecting a single row with empty or null enquiries fields, for those quotes that didn't give rise to any enquiries.</p>
  
  <p>The connecting data is in the quotes table, where there's a field called 'activity' that contains the id of any or all enquiries that resulted.  It's updated each tim e anew enquiry comes in.</p>
  
  <p>So I tried this:</p>
  
  <pre><code>SELECT q.*, e.id, e.price
  FROM quotes as q
  LEFT JOIN enquiries as e
  ON INSTR(q.activity, e.id) &gt;'0'
  WHERE q.date &gt; '2013-07-01'
  </code></pre>
  
  <p>But every row in my results includes enquiries data.  I can't seem to get it to include the quotes that never resulted in anything.  I thought LEFT JOIN was supposed to give me all of the quotes regardless of enquiries, and include the enquiries data where there was a match.  But every example I've seen is just joining on a.id = b.id, so I suspect that my INSTR() match criteria might be messing things up. </p>