title: Select columns, but casting all columns of given type
body: <p>I need something that is the logical equivalent of</p>
  
  <pre><code>select cast(* as numeric IF data_type='decimal') from table_name
  </code></pre>
  
  <p>I didn't know how to do that, so i'm trying to reduce it into two steps:</p>
  
  <pre><code>select * from table_name where data_type!='decimal'
  
  select cast(* as numeric) from table_name where data_type='decimal'
  </code></pre>
  
  <p>But I realized I don't know how to do that, either. I can find the list of column names that are decimal thanks to SO, but as this is a batched process, i can't split this into two steps</p>
  
  <p>Is what I'm trying to do possible? I just want to get a set of columns, but if they're decimal, cast them as double.</p>
  
  <p>Thanks!</p>