SQL query with distinct and sum

前端 未结 4 782
天涯浪人
天涯浪人 2020-12-06 04:46

I have the following medleys table that combines colors, fruits and ratings:

[medleys]
medley_id   |   co         


        
4条回答
  •  自闭症患者
    2020-12-06 05:44

    This should answer your question:

    
    SELECT color, fruit, sum(rating) as [sum]
    FROM medleys
    GROUP BY color, fruit
    ORDER BY color
    

提交回复
热议问题