select * from 你的表 a inner join (select name,max(time) as time from 你的表 group by name) b on a.name = b.name where a.time=b.time解释:首先分组 取出 同一名字下的 最大 time, 然后通过 inner join 链接 查询你的表,条件是 同一name下的最大 time 记录相同!
1.select * from (select rank() over(partition by name order by time desc) rk, table.* from table) twhere t.rk<=1;2.select * from tb a inner join (select name,max(time) as time from tb group by name) b on a.time=b.time你试一下吧 我暂时没法调试