title: SQL query with sum and unique output
body: <p>Let me base my query from the table here: <a href="https://stackoverflow.com/questions/15512628/sql-query-with-distinct-and-sum">SQL query with distinct and sum</a></p>
  
  <p>This table, slightly edited:</p>
  
  <pre><code>medley_id   | class    |  color   |   fruit   |   rating
  ========================================================
  1             sweet       red         apple       25
  2             sour        blue        pear        5
  3             sweet       green       apple       12
  4             sour        red         apple       10
  5             sour        purple      kiwi        5
  6             sweet       purple      kiwi        50
  7             sour        blue        kiwi        3
  8             sour        blue        pear        9
  </code></pre>
  
  <p>I want a query that yields this result:</p>
  
  <pre><code>class       |   color   |   fruit   |   sum
  ============================================
  (multiple)      red         apple       35
  sour            blue        pear        14
  sour            blue        kiwi        3
  sweet           green       apple       12
  (multiple)      purple      kiwi        55
  </code></pre>
  
  <p>(multiple) doesn't have to tell me what the multiple is, it just has to know that it's multiple, but it's not something that makes the row unique in terms of what the sum is.</p>
  
  <p>Does that make sense? Can anyone help? Thanks!</p>