title: How to group a table in Sql?
body: <p>I have the following table, <code>Tasks</code>:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">ID</th>
  <th style="text-align: center;">Task</th>
  <th style="text-align: right;">Type</th>
  <th style="text-align: right;">Time_Taken</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">1</td>
  <td style="text-align: center;">task1</td>
  <td style="text-align: right;">type1</td>
  <td style="text-align: right;">01h:00m</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: center;">task1</td>
  <td style="text-align: right;">type2</td>
  <td style="text-align: right;">02h:00m</td>
  </tr>
  <tr>
  <td style="text-align: left;">3</td>
  <td style="text-align: center;">task2</td>
  <td style="text-align: right;">type1</td>
  <td style="text-align: right;">00h:30m</td>
  </tr>
  <tr>
  <td style="text-align: left;">4</td>
  <td style="text-align: center;">task2</td>
  <td style="text-align: right;">type2</td>
  <td style="text-align: right;">00h:30m</td>
  </tr>
  <tr>
  <td style="text-align: left;">5</td>
  <td style="text-align: center;">task3</td>
  <td style="text-align: right;">type1</td>
  <td style="text-align: right;">01h:00m</td>
  </tr>
  <tr>
  <td style="text-align: left;">6</td>
  <td style="text-align: center;">task3</td>
  <td style="text-align: right;">type2</td>
  <td style="text-align: right;">04h:00m</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want to create a new table from the <code>Tasks</code> table which should be</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">Task</th>
  <th style="text-align: right;">type1_time</th>
  <th style="text-align: right;">type2_time</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">task1</td>
  <td style="text-align: right;">01h:00m</td>
  <td style="text-align: right;">02h:00m</td>
  </tr>
  <tr>
  <td style="text-align: center;">task2</td>
  <td style="text-align: right;">00h:30m</td>
  <td style="text-align: right;">00h:30m</td>
  </tr>
  <tr>
  <td style="text-align: center;">task3</td>
  <td style="text-align: right;">01h:00m</td>
  <td style="text-align: right;">04h:00m</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Can you help me in building an sql query for this?</p>