SUM(DISTINCT) Based on Other Columns

前端 未结 6 1340
没有蜡笔的小新
没有蜡笔的小新 2020-12-10 11:23

I currently have a table that looks something like this:

+------+-------+------------+------------+
| id   | rate  | first_name | last_name  |
+------+-----         


        
6条回答
  •  被撕碎了的回忆
    2020-12-10 11:53

    You can use any of the above code sample provided since with group by clause without any aggregate function will return an indeterminate one record for each grouping condition. You can refer http://dev.mysql.com/doc/refman/5.5/en/group-by-hidden-columns.html link for further reading.

提交回复
热议问题