我现在得到的集合是
1
2
3
3
4
4
4
6
7
怎么能让排序的结果是
1
2
3
4
6
7
3
4
4
4 在线等 谢谢了
oracle排序
------解决方案--------------------
我测试了一下,应该是可以的:
select t.id
from (select distinct t.id, 1 seq
from test5 t
union all
select t1.id, 2 seq
from (select t.id,
row_number() over(partition by t.id order by t.id) rn
from test5 t) t1
where t1.rn > 1
order by seq, id) t;