title: MySQL conditionally UPDATE rows' boolean column values based on a whitelist of ids
body: <p>I'm trying to update a set of records (<em><code>boolean</code> fields</em>) in a single query if possible.</p>
  
  <p>The input is coming from paginated radio controls, so a given <code>POST</code> will have the page's worth of IDs with a <code>true</code> or <code>false</code> value.</p>
  
  <p>I was trying to go this direction:</p>
  
  <pre><code>UPDATE my_table
      SET field = CASE
          WHEN id IN (/* true ids */) THEN TRUE
          WHEN id IN (/* false ids */) THEN FALSE
      END
  </code></pre>
  
  <p>But this resulted in the "true id" rows being updated to <code>true</code>, and <strong>ALL</strong> other rows were updated to <code>false</code>.</p>
  
  <p>I assume I've made some gross syntactical error, or perhaps that I'm approaching this incorrectly.</p>
  
  <p>Any thoughts on a solution?</p>