title: T-SQL PIVOT on one column to append the others
body: <p>Given this table (there's always 2 duplicates of Combinations):</p>
  
  <pre><code>Combination Variable    Value
  -----------------------------
  0           a           1
  0           b           2
  1           c           3
  1           d           4
  2           e           5
  2           f           6
  ...
  </code></pre>
  
  <p>I want to query it to get this:</p>
  
  <pre><code>Variable 0  Value 0     Variable 1  Value 1     Variable 2  Value 2     ...
  ---------------------------------------------------------------------------
  a           1           c           3           e           5
  b           2           d           4           f           6
  </code></pre>
  
  <p>I've tried using PIVOT with dynamic query but cannot come up with a satisfying result.</p>
  
  <p>Can somebody please advise?</p>
  
  <p>EDIT: though Ullas solution works perfectly for combination pairs, I was wondering if it's possible to achieve the same result with combination N-uplets (e.g. (0, 0, 0), (1, 1, 1), (2, 2, 2) should result in 3 rows)? I reckon dynamic query is still the way to go, maybe with PIVOT this time.</p>