with t(d) as
(select GETDATE() union all select d +1 from t where d<GETDATE()+9)
select * from t

构造一个10天日期序列

 

with t(n,m) as
(select 1,getdate() union all select n+1,getdate()+n from t where n<10)
select m from t;

构造一个带序号的日期序列

 

 

相关文章:

  • 2021-08-22
  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
  • 2022-12-23
相关资源
相似解决方案