title: Sum of values in column by row and also selecting other columns in the result set
body: <p>My current query is as follows:</p>
  
  <pre><code>select id, quantity, c, d
  from table1;
  </code></pre>
  
  <p>This would give me example data as below:</p>
  
  <pre><code>id | quantity | c | d
  ---------------------
  1  |    1     | x | y
  1  |    3     | x | y
  2  |    1     | x | y
  2  |    1     | x | y
  </code></pre>
  
  <p>However I want to group by the ID and get the sum of the quantities to be as below:</p>
  
  <pre><code>id | quantity | c | d
  ---------------------
  1  |    4     | x | y
  2  |    2     | x | y
  </code></pre>
  
  <p>I tried to modify my first query to include a group by on the id and a sum on the quantities:</p>
  
  <pre><code>select id, sum(quantity), c, d
  from table1
  group by id;
  </code></pre>
  
  <p>But I got an error because the other 2 columns are not part of the group by clause. How can I include them?</p>