title: SQL- use an attribute to group activities and use the group as parameter
body: <p>I have a table that looks like this:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">ActivityID</th>
  <th style="text-align: center;">Time Used</th>
  <th style="text-align: center;">Activity Type</th>
  <th style="text-align: center;">Activity Category ID</th>
  <th style="text-align: center;">Activity Category</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">123456</td>
  <td style="text-align: center;">30</td>
  <td style="text-align: center;">A</td>
  <td style="text-align: center;">1</td>
  <td style="text-align: center;">X</td>
  </tr>
  <tr>
  <td style="text-align: left;">765432</td>
  <td style="text-align: center;">120</td>
  <td style="text-align: center;">B</td>
  <td style="text-align: center;">2</td>
  <td style="text-align: center;">Y</td>
  </tr>
  <tr>
  <td style="text-align: left;">876462</td>
  <td style="text-align: center;">65</td>
  <td style="text-align: center;">C</td>
  <td style="text-align: center;">3</td>
  <td style="text-align: center;">Z</td>
  </tr>
  <tr>
  <td style="text-align: left;">h52635</td>
  <td style="text-align: center;">76</td>
  <td style="text-align: center;">D</td>
  <td style="text-align: center;">3</td>
  <td style="text-align: center;">Z</td>
  </tr>
  <tr>
  <td style="text-align: left;">hsgs62</td>
  <td style="text-align: center;">187</td>
  <td style="text-align: center;">E</td>
  <td style="text-align: center;">1</td>
  <td style="text-align: center;">X</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I would like to use the <code>Activity Category</code> as parameter (<code>@ActivityCategory</code>) to filter my report later, it means the filter should be X;Y;Z.</p>
  <p>When I choose one Activity Category, the sum of &quot;Time used&quot; should appear.</p>
  <p>My question is: how should I build the query, to be able to group the activities with the same Activity Category together and use the Category XYZ as a parameter?</p>