title: IF (SUBQUERY) = SOMETHING SELECT A ELSE SELECT B MySql
body: <p>In Sql Server, I can do something like this:</p>
  
  <pre><code>IF (SELECT COUNT(*) FROM TABLE WHERE COLUMN=VALUE) = 0
  SELECT 1,2,3
  ELSE SELECT A,B,C FROM TABLE WHERE COLUMN=VALUE
  </code></pre>
  
  <p>I use that a lot, but now I have to work with MySql and I can't really get that to work :)</p>
  
  <p>I guess the same applies to an upsert:</p>
  
  <pre><code>IF (SELECT COUNT(*) FROM TABLE WHERE COLUMN=VALUE) = 0
  INSERT INTO TABLE(COLUMN, OTHERCOLUMN) VALUES(VALUE, OTHERVALUE)
  ELSE
  UPDATE TABLE SET OTHERCOLUMN=OTHERVALUE WHERE COLUMN=VALUE
  </code></pre>
  
  <p>Ho do you do 'if subquery else' in MySql?</p>