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

 

相关文章:

  • 2021-11-15
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2021-12-28
  • 2022-01-01
  • 2021-06-25
猜你喜欢
  • 2022-03-13
  • 2021-04-12
  • 2021-12-15
  • 2021-07-19
  • 2021-11-14
  • 2021-10-05
相关资源
相似解决方案