[
https://issues.apache.org/jira/browse/CALCITE-1921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16143398#comment-16143398
]
sunjincheng edited comment on CALCITE-1921 at 8/28/17 5:57 AM:
---------------------------------------------------------------
Ah, Yes for MySQL-compatible mode i want add DAY(date) is a synonym for
DAYOFMONTH(date).
DAYOFMONTH('2007-02-03') -> 3 and DAY('2007-02-03') -> 3
Just like the description of MYSQL's documentation.
was (Author: sunjincheng121):
Ah, Yes for MySQL-compatible mode i want add DAY(date) is a synonym for
DAYOFMONTH(date).
DAYOFMONTH('2007-02-03') -> 3 and DAY('2007-02-03') -> 3
> Add DAY as Reserved Function Name, And add day() build-in scalar function
> -------------------------------------------------------------------------
>
> Key: CALCITE-1921
> URL: https://issues.apache.org/jira/browse/CALCITE-1921
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: sunjincheng
> Assignee: sunjincheng
>
> I want add `DAY()` as build-in scalar function in calcite. It's looks like as
> following:
> DAY('2015-04-30 01:01:01.1234567') -> 30
> DAYOFMONTH('2007-02-03') -> 3
> What do you think [~julianhyde] :-) ?
> * MySql: DAY() is a synonym for DAYOFMONTH().
>
> https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_day
> * MsSql: DAY returns the same value as DATEPART (day, date).
> https://docs.microsoft.com/en-us/sql/t-sql/functions/day-transact-sql
> * Oracle: Do not support `Day()`
>
> http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions002.htm#SQLRF51179
> * SQL2003:
> http://jtc1sc32.org/doc/N2301-2350/32N2311T-text_for_ballot-CD_9075-2.pdf
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)