title: Statement blocks in SQL SELECT using IF ELSE
body: <p>I'm trying to return different data depending on a variable in a <code>SELECT</code>. Something like this:</p>
  
  <pre><code>SELECT
     IF @variable = 'YES'
        column1, column2
     ELSE
        column3
  FROM TABLE
  </code></pre>
  
  <p>What is this the proper way to use the <code>IF</code> condition in SQL? Or is there a better alternative to what I'm trying to accomplish?</p>