|
|
Archives of the TeradataForum
Message Posted: Wed, 10 Mar 2004 @ 13:56:35 GMT
Subj: | | Re: SQL for a Weekly Summary? |
|
From: | | Lerner, Dirk |
Hi Manish,
you can do it also with group by:
SELECT MIN(CALENDAR_DATE) FIRST_DATE
,MAX(CALENDAR_DATE) LAST_DATE
,MIN(DAY_OF_YEAR) FIRST_DAY
,MAX(DAY_OF_YEAR) LAST_DAY
,MAX(YEAR_OF_CALENDAR) YEAR_OF_CALENDAR
,MAX(MONTH_OF_YEAR) MONTH_OF_CALENDAR
,WEEK_OF_CALENDAR WEEK_OF_CALENDAR
FROM SYS_CALENDAR.CALENDAR
GROUP BY WEEK_OF_CALENDAR
The first day of the week is sunday!
Regards,
Dirk
| |