[ 
https://issues.apache.org/jira/browse/FLINK-28929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Weijie Guo updated FLINK-28929:
-------------------------------
    Fix Version/s: 2.0.0
                       (was: 1.20.0)

> Add built-in datediff function.
> -------------------------------
>
>                 Key: FLINK-28929
>                 URL: https://issues.apache.org/jira/browse/FLINK-28929
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / API
>    Affects Versions: 1.17.0
>            Reporter: Jacky Lau
>            Assignee: Jacky Lau
>            Priority: Major
>              Labels: pull-request-available, stale-assigned
>             Fix For: 2.0.0
>
>
> Syntax:
> {code:java}
> DATEDIFF(expr1,expr2){code}
> Returns:
> returns _{{expr1}}_ − _{{expr2}}_ expressed as a value in days from one date 
> to the other. _{{expr1}}_ and _{{expr2}}_ are date or date-and-time 
> expressions. Only the date parts of the values are used in the calculation.
> This function returns {{NULL}} if _{{expr1}}_ or _{{expr2}}_ is {{{}NULL{}}}.
> Examples:
> {code:java}
> > SELECT DATEDIFF('2007-12-31 23:59:59','2007-12-30');
>         -> 1
> > SELECT DATEDIFF('2010-11-30 23:59:59','2010-12-31');
>         -> -31{code}
> See more:
>  * mysql: 
> [https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_datediff]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to