title: mysql SELECT IN followed by comma separated field
body: <p>I use mySQL and I have a members table with a BLOB 'contacts' field containing a comma separated list of other member's IDs:</p>
  
  <pre><code>TABLE members:
  id_member = 1
  firstname = 'John'
  contacts (BLOB) = '4,6,7,2,5'
  </code></pre>
  
  <p>I want to retrieve all the first names in the 'contacts' list of an individual, with a single query. I tried the following:</p>
  
  <pre><code>SELECT firstname from members WHERE id_member IN ( SELECT contacts FROM members WHERE id_member = 1 );
  </code></pre>
  
  <p>It returns only one row, but when I try:</p>
  
  <pre><code>SELECT firstname from members WHERE id_member IN ( 4,6,7,2,5 );
  </code></pre>
  
  <p>It returns all the first names from the list. I can use two queries to achieve this, but I thought I'd double check if there's a way to make it work with one simple, elegant query.</p>
  
  <p>Thanks for reading, any help appreciated.
  Jul</p>