数字辅助表:

使用CTE生成辅助表(数字或时间)等

 

DECLARE @start_digital INT = 0,
        @end_digital INT = 9

;WITH Digital_Rangs(Digital) 
AS
(
    SELECT  @start_digital 
    UNION ALL
    SELECT [Digital] = [Digital] + 1
    FROM [Digital_Rangs]
    WHERE [Digital] < @end_digital
)

SELECT [Digital] FROM [Digital_Rangs] Option (MaxRecursion 0);
Source Code

相关文章:

  • 2021-09-27
  • 2022-12-23
  • 2021-12-11
  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
猜你喜欢
  • 2021-10-08
  • 2021-10-15
  • 2023-02-21
  • 2021-09-04
  • 2021-09-02
  • 2022-01-23
  • 2021-07-07
相关资源
相似解决方案