Created
February 22, 2012 11:32
-
-
Save nakaji/1884379 to your computer and use it in GitHub Desktop.
CTEで日付の一覧を作る
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with l_date(salesdate) as ( | |
select convert(datetime, '2012/02/01', 111) | |
union all | |
select dateadd(d, 1, salesdate) | |
from l_date | |
where salesdate <= convert(datetime, '2012/02/28', 111) | |
) | |
select * from l_date |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment