title: PostgreSQL crosstab transpose row to column
body: <p>Hi guys im trying to transpose a row query result to 1 row per columns</p>
  
  <p>1st query is <strong>select * from sku;</strong>
  the result is :</p>
  
  <pre><code>id sku  sku_code travel_code     
  1   sku1    1   1
  2   sku1    2   2
  3   sku1    3   3
  4   sku1    4   4
  5   sku1    5   5
  6   sku1    6   6
  7   sku1    7   7
  8   sku2    8   8
  9   sku2    9   9
  10  sku2    10  10
  11  sku2    11  11
  12  sku2    12  12
  13  sku2    13  13
  14  sku2    14  14
  15  sku3    15  15
  16  sku3    16  16
  17  sku3    17  17
  18  sku3    18  18
  19  sku3    19  19
  20  sku3    20  21
  21  sku3    21  21
  </code></pre>
  
  <p>expected output is</p>
  
  <pre><code>SKU   SKU_CODE           TRAVEL_CODE  
  sku1  1  2  3   4  5  6  7  1  2  3  4  5  6  7 
  sku2  8  9  10 11 12 13  14  8  9 10 11 12 13 14
  sku3  15 16 17 18 19 20  21 15 16 17 18 19 20 21 
  </code></pre>
  
  <p>no header is ok</p>