SQL Server 生成时间序列

 
  
WITH DateSequence AS (    
SELECT CONVERT(DATETIME,'20150101') AS DateNum    
UNION ALL    
SELECT DateNum+1    
  FROM DateSequence    
 WHERE DateNum
 
 

你可能感兴趣的:(SQL,Server)