Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 10 Mar 2004 @ 13:56:35 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 27 Dec 2016