title: SQL How to SUM rows in second column if first column contain
body: <p>View of a table</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">ID</th>
  <th style="text-align: right;">kWh</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">1</td>
  <td style="text-align: right;">3</td>
  </tr>
  <tr>
  <td style="text-align: left;">1</td>
  <td style="text-align: right;">10</td>
  </tr>
  <tr>
  <td style="text-align: left;">1</td>
  <td style="text-align: right;">8</td>
  </tr>
  <tr>
  <td style="text-align: left;">1</td>
  <td style="text-align: right;">11</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: right;">12</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: right;">4</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: right;">7</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: right;">8</td>
  </tr>
  <tr>
  <td style="text-align: left;">3</td>
  <td style="text-align: right;">3</td>
  </tr>
  <tr>
  <td style="text-align: left;">3</td>
  <td style="text-align: right;">4</td>
  </tr>
  <tr>
  <td style="text-align: left;">3</td>
  <td style="text-align: right;">5</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want to recive</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">ID</th>
  <th style="text-align: right;">kWh</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">1</td>
  <td style="text-align: right;">32</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: right;">31</td>
  </tr>
  <tr>
  <td style="text-align: left;">3</td>
  <td style="text-align: right;">12</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>The table itself is more complex and larger. But the point is this. How can this be done? And I can't know in advance the ID numbers of the first column.</p>