title: Combine columns in result from SQL SELECT
body: <p>I am trying to solve following problem:</p>
  
  <p>I have a table with timeStamp column and three columns for different types of variables. The columns with values are filled randomly according to the conditions. So it looks like this:</p>
  
  <blockquote>
    <p><br>smpl_time  &nbsp;float_val  &nbsp;num_val  &nbsp;str_val <br>15:31
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NULL
    <br>15:32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;15.4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NULL
    <br>15:33&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Disabled
    <br></p>
  </blockquote>
  
  <p>What I would like to achieve is a result that would merge all val fields into one column and sorts them according to timeStamp:</p>
  
  <blockquote>
    <p><br>smpl_time  merge_val
    <br>15:31&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10
    <br>15:32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;15.4
    <br>15:33&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Disabled</p>
  </blockquote>
  
  <p><br><br>
  So far I have a SELECT just for one val type looking like this (it contains also other field from the table that are common for each entry):
  <br></p>
  
  <pre><code>SELECT s.smpl_time AS Time,s.float_val AS Value, e.name AS Severity, m.name AS Status 
  FROM sample s JOIN channel c ON c.channel_id=s.channel_id JOIN severity e ON
  e.severity_id=s.severity_id JOIN status m ON m.status_id=s.status_id WHERE
  s.channel_id='id' AND smpl_time BETWEEN TIMESTAMP 'startTime' AND TIMESTAMP 'stopTime';
  </code></pre>
  
  <p><br>
  Does anyone have an idea how to do this or if it is even possible?</p>
  
  <p>Cheers,</p>
  
  <p>Mike</p>