日期:2014-05-19  浏览次数:20490 次

制作编号
编号定长7,
0000001
0000002
.....
0000010
.....
0000100

------解决方案--------------------
select a+10*b+1 as n
from (
select 0 as a
union all select 1
union all select 2
union all select 3
union all select 4
union all select 5
union all select 6
union all select 7
union all select 8
union all select 9
) as t1,(
select 0 as b
union all select 1
union all select 2
union all select 3
union all select 4
union all select 5
union all select 6
union all select 7
union all select 8
union all select 9
) as t2
order by n