title: How to combine SELECT of reguler column with SELECT of SUM of the columns in one query?
body: <p>This is my query that does not work as intended:</p>
  
  <pre><code>SELECT `id`, SUM(`column1`) as `c1`, SUM(`column2`) AS `c2` 
  FROM `table` 
  WHERE `id` IN (18, 19, 20, 21)
  </code></pre>
  
  <p>What I'd like to get from it: I want to get <code>SUM(column1)</code> and <code>SUM(column2)</code> for every <code>id</code> listed in the <code>WHERE</code> part, and the "distinct" <code>id</code> that matches with it. I have no idea how to combine regular column SELECT with SUM column SELECT in one query - if it is even possible? Example:</p>
  
  <pre><code>`table` structure:
  id column1 column2
  18    5      3
  18    5      3
  20    10     10
  20    10     5
  20    10     5
  21    1      1
  22    10     10
  
  Should return:
  id  c1  c2
  18  10  6
  20  30  20
  21  1   1
  </code></pre>