chenyunren created TRAFODION-3118:
-------------------------------------

             Summary: Improve on parts of EXTRACT constructs.
                 Key: TRAFODION-3118
                 URL: https://issues.apache.org/jira/browse/TRAFODION-3118
             Project: Apache Trafodion
          Issue Type: Improvement
            Reporter: chenyunren
            Assignee: chenyunren


add  DAYOFYEAR (with alias DOY), DAYOFWEEK (with alias DOW), WEEK(weekofyear), 
WEEKOFMONTH, QUARTER,  EPOCH,CENTURY, DECADE to function EXTRACT 

 
|century|The century
 support: datetime|EXTRACT(CENTURY FROM TIMESTAMP '2000-11-20 12:30:00'); 
 Result: 20
 EXTRACT(CENTURY FROM TIMESTAMP '2001-01-01 12:30:00');
 Result: 21|
|decade|The year divided by 10
 support: datetime interval|EXTRACT(DECADE FROM TIMESTAMP '2001-02-16 
20:38:40');
 Result: 200
 EXTRACT(DECADE FROM INTERVAL '9' YEAR - INTERVAL '99' YEAR);
 Result: -9|
|week
 (weekofyear)|week number of year (1-53) (The first week starts on the first 
day of the year.)
 support: datetime|EXTRACT(WEEK FROM DATE '2005-01-01'); 
 Result:1|
|epoch|the number of seconds since 1970-01-01 00:00:00 UTC (can be negative); 
for interval values, the total number of seconds in the interval
 support: datetime interval|EXTRACT(EPOCH FROM TIMESTAMP '2000-12-30 
20:38:40.12');
 Result: 978208720.12
 EXTRACT(EPOCH FROM INTERVAL '2' YEAR - INTERVAL '3' MONTH)
 Result: 54885600|
|quarter|The quarter of the year (1 - 4) 
 support: datetime interval|EXTRACT(QUARTER FROM DATE '2007-02-16'); 
 Result: 1
 EXTRACT(QUARTER FROM INTERVAL '09' MONTH);
 Result: 3|
|dow
 (dayofweek)|The day of the week as Sunday (1) to Saturday (7)
 support: datetime|EXTRACT(DOW FROM TIMESTAMP '2018-06-21 20:38:40'); 
 Result: 5|
|doy
 (dayofyear)|The day of the year (1 - 365/366)
 support: datetime|EXTRACT(DOY FROM TIMESTAMP '2018-06-21 20:38:40');
  Result: 172|
|wom
 (weekofmonth)|Returns a number for the count of week in the current 
month(1-5). (The first week starts on the first day of the month.)
 support: datetime|EXTRACT(WOM FROM TIMESTAMP '2018-06-21 20:38:40'); 
 Result: 3|



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to