0

我有 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
.
.
.

先感谢您!

4

3 回答 3

1

select id, sum(minutes_played) from tableName group by id

于 2012-10-16T14:25:36.200 回答
1
SELECT ID, SUM(MINUTES_PLAYED)
FROM MYTABLE
GROUP BY ID
于 2012-10-16T14:25:41.333 回答
0

只需将它们相加:

SELECT ID, SUM(MINUTES_PLAYED) AS TOTAL_MINUTES
FROM table GROUP BY ID
于 2012-10-16T14:26:01.707 回答