title: MySQL CASE...WHERE...THEN statements
body: <p>I have a MySQL UPDATE statement that uses a CASE clause</p>
  
  <pre><code>UPDATE partsList SET quantity =  
  CASE
    WHEN partFK = 1 THEN 4
    WHEN partFK = 2 THEN 8
  END
  WHERE buildFK = 1;
  </code></pre>
  
  <p>The above statement works. Yet when I remove one of the WHEN statements, it breaks and the error indicates the CASE clause isn't returning anything. Is it that the CASE clause must have more than one WHEN to function.</p>
  
  <p>I don't know beforehand how many updates I'll need, so I'm trying to build a single update statement that can handle one or many updates.</p>
  
  <p>Thanks for any insights you can provide.</p>