title: Unroll table with multiple keys and values in each row with sql
body: <p>How can I "unroll" a table with multiple keys and values in each row to a table with one key and value in each row?</p>
  
  <p>For example I have a table  </p>
  
  <pre><code>key1 value1 key2 value2  
  a    1      b    2  
  c    3      d    4  
  e    5      f    6 
  </code></pre>
  
  <p>and I want to change it into  </p>
  
  <pre><code>key value  
  a   1  
  b   2  
  c   3  
  d   4  
  e   5  
  f   6  
  </code></pre>
  
  <p>There are only two keys and values in each row above but I need the solution for general case, where I may have up to 7 pairs in each row.</p>