oracle 排序问题我现在得到的集合是123344467怎么能让排序的结果是1234673444在线等 谢谢了oracle排序[解
oracle 排序问题
我现在得到的集合是
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;
