Wednesday, 2 June 2010

Auxiliary CTE of Months - SQL

WITH CTE_Months
AS
(
SELECT Mths ='January ' UNION ALL
SELECT Mths ='February ' UNION ALL
SELECT Mths ='March ' UNION ALL
SELECT Mths ='April ' UNION ALL
SELECT Mths ='May ' UNION ALL
SELECT Mths ='June ' UNION ALL
SELECT Mths ='July ' UNION ALL
SELECT Mths ='August ' UNION ALL
SELECT
Mths ='September ' UNION ALL
SELECT Mths ='October ' UNION ALL
SELECT
Mths ='November ' UNION ALL
SELECT
Mths ='December '
)
SELECT Mths FROM CTE_Months

No comments: