* 특정년도의 일자를 쭉 리스트
-- view 생성
create view v_calendar_temp1
as
select 0 n
union all select 1
union all select 2
union all select 3
;
-- view 생성
create view v_calendar_temp2
as
select 0 n
union all select 1
union all select 2
union all select 3
union all select 4
union all select 5
union all select 6
union all select 7
union all select 8
union all select 9
;
-- 쿼리
select (date_format(now(), '%Y0101') + INTERVAL a.n*100 + b.n*10 + c.n DAY) as calendar_date
FROM v_calendar_temp1 a,
v_calendar_temp2 b,
v_calendar_temp2 c
order by 1
;
반응형
'잡다한 자료' 카테고리의 다른 글
맥. 독의 사파리 아이콘이 이상한걸로 변경되었을때. (2) | 2017.11.13 |
---|---|
맥. http client 디버거. restful api 디버거 (0) | 2016.10.19 |
Google Analytics. Real Time Reporting API (1) | 2016.06.29 |
slack, dapulse 연동 (3) | 2016.06.20 |
mysql. 데이타파일. 로그파일 이동 (0) | 2016.03.24 |