Mysql SQLite在一个表上选择station

Mysql SQLite在一个表上选择station,mysql,sql,sqlite,select,Mysql,Sql,Sqlite,Select,我有一张colums的表格:游戏类型得分时间,我想选择一种游戏类型的最佳得分。在这个分数上,我想在特定的游戏、类型和分数上获得最低的时间 我和一组人一起骑三轮车,但我没有得到我想要的 SELECT game, type, MAX(score),MIN(time) FROM table GROUP BY game,type 我想要的是: 如果这是我的桌子: 0/1/0/672 0/1/0/749 0/1/1/2091 0/1/1/3252 0/5/0/5088 0/5/0/550

我有一张colums的表格:游戏类型得分时间,我想选择一种游戏类型的最佳得分。在这个分数上,我想在特定的游戏、类型和分数上获得最低的时间

我和一组人一起骑三轮车,但我没有得到我想要的

SELECT game, type, MAX(score),MIN(time)
FROM table
GROUP BY game,type 
我想要的是: 如果这是我的桌子:

 0/1/0/672
 0/1/0/749
 0/1/1/2091
 0/1/1/3252

 0/5/0/5088
 0/5/0/5504
 0/5/1/6482
 0/5/2/9408
 0/5/2/24616
 0/5/3/6592 
 0/5/4/8706

 1/1/0/700
 1/1/1/1151

 1/5/5/4808

 3/1/1/1038
我想要这样的输出:

 0/1/1/2091
 0/5/4/8706
 1/1/1/1151
 1/5/5/4808
 3/1/1/1038

获得此结果最有效的方法是什么?

您不能在单个聚合中完成此操作:

SELECT s.game, s.type, s.score, MIN(t.time) AS time
FROM (
    SELECT tt.game, tt.type, MAX(tt.score) AS score 
    FROM table tt 
    GROUP BY tt.game, tt.type
) s 
INNER JOIN table t ON s.game = t.game AND s.type = t.type AND s.score = t.score
GROUP BY s.game, s.type, s.score