------解决方案--------------------
有点错了,修改一下 with a as( select 1 as id , 'aa' as name from dual union all select 2 as id , 'bb' as name from dual union all select 3 as id , 'bb' as name from dual union all select 5 as id , 'bb' as name from dual union all select 9 as id , 'cc' as name from dual) select b.mi from (select a.id, rownum mi from a order by a.id) b where b.id <> b.mi and rownum = 1 order by b.id