You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "sunjincheng (JIRA)" <ji...@apache.org> on 2017/06/04 13:10:04 UTC

[jira] [Updated] (FLINK-6813) Add DATEDIFF supported in SQL

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

sunjincheng updated FLINK-6813:
-------------------------------
    Summary: Add DATEDIFF supported in SQL  (was: Add DATEDIFF as build-in scalar function)

> Add DATEDIFF supported in SQL
> -----------------------------
>
>                 Key: FLINK-6813
>                 URL: https://issues.apache.org/jira/browse/FLINK-6813
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API & SQL
>    Affects Versions: 1.4.0
>            Reporter: sunjincheng
>            Assignee: sunjincheng
>
> * Syntax
> DATEDIFF ( datepart , startdate , enddate )
> -datepart
> Is the part of startdate and enddate that specifies the type of boundary crossed.
> -startdate
> Is an expression that can be resolved to a time, date.
> -enddate
> Same with startdate.
> * Example
> SELECT DATEDIFF(year, '2015-12-31 23:59:59.9999999', '2017-01-01 00:00:00.0000000')  from tab; --> 2



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)