我有3个专栏:'GAME''PLAYER_ID''MINUTES_PLAYED'
看起来像这样:
GAME ID MINUTES_PLAYED
12550788 229569 23
12500788 393438 4
12500788 458730 25
12500782 229569 10
我想找到每场比赛的总分钟数,即
ID TOTAL_MINUTES
229569 33
.
.
.
提前谢谢!
答案 0 :(得分:1)
select id, sum(minutes_played) from tableName group by id
答案 1 :(得分:1)
SELECT ID, SUM(MINUTES_PLAYED)
FROM MYTABLE
GROUP BY ID
答案 2 :(得分:0)
只需添加它们:
SELECT ID, SUM(MINUTES_PLAYED) AS TOTAL_MINUTES
FROM table GROUP BY ID