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

[jira] [Created] (FLINK-6813) Add DATEDIFF as build-in scalar function

sunjincheng created FLINK-6813:
----------------------------------

             Summary: Add DATEDIFF as build-in scalar function
                 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)