我喜欢的聚合子查询来解决求每组前N名的方式:
select a.user_name, b.timestr, b.kills
from user1 as a inner join user_kills as b
on a.user_id = b.user_id
where (select count(c.user_id) from user_kills as c where c.kills > b.kills) < 2;
select a.user_name, b.timestr, b.kills
from user1 as a inner join user_kills as b
on a.user_id = b.user_id
where (select count(c.user_id) from user_kills as c where c.kills > b.kills) < 2;
2016-10-23