select
zhuyh , mingxh , bianh , mingc
from (
select
t.zhuyh , t.mingxh , t.bianh,t.mingc,
row_number() OVER(PARTITION BY t.zhuyh ORDER BY t.zhuyh desc) as row_flg
from jzd t ) temp
where temp.row_flg = ‘1‘
原文:https://www.cnblogs.com/maweiwei/p/12664589.html