title: How to use case in db2 column select query
body: <p>I have a table in which there is a varchar column <code>'someid'</code> and some timestamp columns:
  <code>'date_1', ... , date_4</code> and <code>'xdate_1', ... , xdate_4</code>
   I am trying to select two of them depending on 'someid' value, but had no luck until now. I am sure that this is syntax, googling also didn't help as all the examples were similar to my query.</p>
  
  <p>Heres what I'm trying to do:</p>
  
  <pre><code>select
    case
      when someid = 1 then date_1
      when someid = 2 then date_2
      when someid = 3 then date_3
      when someid = 4 then date_4
   ,case
      when someid = 1 then xdate_1
      when someid = 2 then xdate_2
      when someid = 3 then xdate_3
      when someid = 4 then xdate_4
  from mytable;
  </code></pre>