[
https://issues.apache.org/jira/browse/TRAFODION-3150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16553123#comment-16553123
]
Hans Zeller commented on TRAFODION-3150:
----------------------------------------
Thank you for looking into this. From what I understand from you, we are
dealing with maybe two issues:
The week number algorithm used in Trafodion is different from that used in
Oracle and PostgreSQL. Note that neither of them conforms to the ISO 8601
standard.
I found these two pages, explaining the US scheme and the ISO week number,
which seems to be used in Europe:
[https://blogs.msdn.microsoft.com/oldnewthing/20160311-00/?p=93144]
[https://en.wikipedia.org/wiki/ISO_week_date]
Note that the first link has the week in your example and it also shows 2 as
the week number.
I found this on the Oracle web site,
[https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm#i34510]
WW Week of year (1-53) where week 1 starts on the first day of the year and
continues to the seventh day of the year.
This seems to be yet another way to compute the week. I'm not sure where this
method is used. Maybe we should talk about which methods for week number we
want to support in Trafodion and how we can get these different methods to work.
I agree that since TO_CHAR is basically an Oracle function, it would be nice if
it could work similar to Oracle. On the other hand, I'm not sure whether the
Oracle week numbering system makes sense (is it used in any country?) and
whether we could and should introduce an incompatible change.
The same Oracle page also confirms what you say, that "hh12" should return1 and
not 0.
> to_char and extract function's new options bug
> ----------------------------------------------
>
> Key: TRAFODION-3150
> URL: https://issues.apache.org/jira/browse/TRAFODION-3150
> Project: Apache Trafodion
> Issue Type: Bug
> Reporter: chenyunren
> Priority: Major
>
> 1.select extract(quarter from interval '99' month) from dual;
> return:33
> should return 1
> 2.select extract(week from date '2016-01-03') from dual;
> return:2
> should return 1
> 3.select to_char(date '2016-01-03','ww') from dual;
> return:2
> should return 1
> 4.select to_char(time '00:00:01', 'hh12') from dual;
> return:00
> should return 12
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)