1.创建查询辅助表
create table nums (n int not null) alter table nums add constraint PK_NUMS primary key clustered(n) ;with cte as ( select 1 as n union all select n+1 from cte where n<=99 ) insert into nums select (a.n-1)*10000+(b.n-1)*100+c.n from cte a inner join cte b on 1=1 inner join cte c on 1=1 order by 1