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