SQl server master

取一段连续时间

 

SELECT  DISTINCT

 

        CONVERT(VARCHAR(7), DATEADD(month, -number,
                                    CONVERT(VARCHAR(11), GETDATE(), 120)), 120) AS NewDate
FROM    master..spt_values
WHERE   type = 'p'
        AND number BETWEEN 0 AND 11

你可能感兴趣的:(SQl server master)