考虑一个名为 的假想表的以下表结构score
:
player_name |player_lastname |try |score
primary key: (player_name,player_lastname,try)
(不讨论表模式,它只是一个例子)
该表包含所有玩家的分数 - 每个玩家应该能够玩一次或两次。现在,我怎样才能只获取每个玩家最后一次尝试的数据(即,对于那些玩了不止一次的人来说,第一次尝试应该被忽略)?
我试图实现的一个例子:
player_name,player_lastname,try,score
=====================================
bart, simpson,1,250
lisa,simpson,1,150
lisa,simpson,2,250
homer,simpson,1,300
homer,simpson,2,350
maggi,simpson,1,50
结果应该是:
player_name,player_lastname,try,score
=====================================
bart, simpson,1,250
lisa,simpson,2,250
homer,simpson,2,350
maggi,simpson,1,50