分组找ID

select t.name1,t.name2,t.zx
from (select row_number()over(partition by name1 order by zx desc)rn, test.* from test)t
where t.rn=1;

posted @ 2015-12-11 16:34  海贼王&汉库克  阅读(146)  评论(0编辑  收藏  举报