Let me base my query from the table here: SQL query with distinct and sum
This table, slightly edited:
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
I want a query that yields this result:
class | color | fruit | sum
============================================
(multiple) red apple 35
sour blue pear 14
sour blue kiwi 3
sweet green apple 12
(multiple) purple kiwi 55
(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.
Does that make sense? Can anyone help? Thanks!