你这个有点不常规啊,这样吧
select T.A,T.ANUMBERfrom(select A.*,row_number() over(partition by A,ANUMBER order by 1) rn from Aminusselect A1.*,row_number() over(partition by A,ANUMBER order by 1) rn from A1) T