title: update set statement with a conditional expression
body: <p>I need to do an update query where I'm setting a value based on results from a count query.  If the count returns no results, I want to set the status to 1, otherwise i want to set the status to 2.</p>
  
  <p>Here's my attempt which doesn't work:</p>
  
  <pre><code>UPDATE TABLE_1 SET status = ((select count(1) from TABLE_2) &gt; 0 ? 1 : 2)
  </code></pre>
  
  <p>Also, I'm doing this within a mybatis xml file, so if there is some magic I can do in mybatis that would work too.</p>