title: SQL - loop query when WHERE condition comes from list
body: <p>I have a mysql db table which contains a number of bibliographic records. It's formatted a little like this:</p>
  
  <pre><code>field content |field title |barcode
  Black Beauty  |Title       |9781235842
  James Joyce   |Author      |9781452585
  </code></pre>
  
  <p>There are a few dozen possible field titles.</p>
  
  <p>Each record is effectively spread over a number of rows, the record is the combined rows which share the barcode.</p>
  
  <p>I want to see what items have short records. </p>
  
  <p>I have a working query for a specific barcode:</p>
  
  <p><code>
  select barcode, sum(length(field_content)) 
  from central
  where barcode = 420908032337
  ;
  </code></p>
  
  <p>And I have a list of 1.3k suspect barcodes. Is there a way to run the SQL query by looping through this list? </p>
  
  <p>I am on a work machine and have access to HeidiSQL, git bash [including grep etc] but won't be able to install php, ruby etc for scripting.</p>