01
01-01-01
01-01-01-01
01-01-01-02
我想
在01 和01-01-01之间插入4行数据形成新的编号
示意
01
1
2
3
4
01-01-01
01-01-01-01
01-01-01-02
01-01-01
01-01-01-01
01-01-01-02
我想
在01 和01-01-01之间插入4行数据形成新的编号
示意
01
1
2
3
4
01-01-01
01-01-01-01
01-01-01-02
insert into @t
select '01' union
select '1' union
select '2' union
select '3' union
select '4' union
select '01-01-01' union
select '01-01-01-01' union
select '01-01-01-02'select * from @t order by (len(id)-1)/2,id/*
id
--------------------
01
1
2
3
4
01-01-01
01-01-01-01
01-01-01-02
*/