title: How to join a CSV list to a table column
body: <p>I have a table like so:</p>
  
  <pre><code>CREATE TABLE `my_table` (
      `id` INT(10) AUTO_INCREMENT,
      `code` VARCHAR(50),
      `new_table_id` INT(10)
      PRIMARY KEY (`id`)
  )
  </code></pre>
  
  <p>And I have a CSV list of code values like so:</p>
  
  <pre><code>'23000005619',
  '23000019479',
  '23000019759',
  '23000030169',
  '23000032629'
  </code></pre>
  
  <p>I want to join this list with <code>my_table</code>.<code>code</code> column such that I can find the value to <code>my_table</code>.<code>new_table_id</code> so I can join that to another table.</p>
  
  <p>My initial thoughts are something along the lines of this (but obviously not syntactically correct):</p>
  
  <pre><code>SELECT *
  FROM my_table mt,
  (
    SELECT
      '23000005619',
      '23000019479',
      '23000019759',
      '23000030169',
      '23000032629'
  ) as ml
  WHERE mt.`code` = m1.xx
  </code></pre>
  
  <p>Any help would be greatly appreciated. Thanks</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I would like to avoid temp tables where possible</p>