title: Select a specific column based on another column's value
body: <p>I have a table like this</p>
  
  <pre><code>ID | Type | Val0 | Val1
  1  |  0   |  A   | NULL
  2  |  1   | NULL |  B
  </code></pre>
  
  <p>I need to select <code>Val0</code> when the type is 0, and <code>Val1</code> when the type is 1, and <code>ValN</code> when type is N...</p>
  
  <p>How can I do that?</p>