title: SQL - Combine different rows into a single row with different ID
body: <p>The table from different id needs to combine into a single row</p>
  <pre><code>        +-----+-----+-----+-----+
          | Id  | Col1| Col2| Col3|
          +-----+-----+-----+-----+
          | 1   |     |   1 |     |
          | 2   |     |   2 |     |
          | 3   |   3 |     |     |
          | 4   |   4 |     |     |
          | 5   |     |     |   5 |
          | 6   |     |     |   6 |
          +-----+-----+-----+-----+
  </code></pre>
  <p>What I want to achieve in the same table.</p>
  <pre><code>        +-----+-----+-----+-----+
          | Id  | Col1| Col2| Col3|
          +-----+-----+-----+-----+
          | 1   |   3 |   1 |   5 |
          | 2   |   4 |   2 |   6 |
          +-----+-----+-----+-----+
  </code></pre>
  <p>What I had tried to aggregate the rows from using different id</p>
  <pre><code>Select ID
        ,ID1 = max(Col1)
        ,ID2 = max(Col2)
        ,ID3 = max(Col3)
   From  Tbl
   Group By ID
  </code></pre>