[
https://issues.apache.org/jira/browse/TRAFODION-3277?focusedWorklogId=201068&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-201068
]
ASF GitHub Bot logged work on TRAFODION-3277:
---------------------------------------------
Author: ASF GitHub Bot
Created on: 20/Feb/19 03:47
Start Date: 20/Feb/19 03:47
Worklog Time Spent: 10m
Work Description: liuyu000 commented on pull request #1799:
[TRAFODION-3277] Add *OVERLAPS predicate* in Trafodion SQL Reference Manual
URL: https://github.com/apache/trafodion/pull/1799#discussion_r258324614
##########
File path: docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc
##########
@@ -3694,6 +3694,393 @@ evaluates to null:
(first_name, salary) IS NULL
```
+<<<
+[[overlaps_predicate]]
+=== OVERLAPS Predicate
+
+The OVERLAPS predicate evaluates whether two date-time periods overlap each
other. The date-time period is a pair of date-time expressions.
+
+```
+(start 1, end 1) OVERLAPS (start 2, end 2)
+```
+
+[[syntax_description_of_overlaps]]
+==== Syntax Description of OVERLAPS
+
+* `_start 1, start 2_`
+
++
+Specifies the beginning of a date-time period, which can be a DATE, TIME or
TIMESTAMP value.
+
++
+NOTE: `_start 1, start 2_` cannot be NULL.
+
+
+* `_end 1, end 2_`
++
+Specifies the end of a date-time period, which can be a DATE, TIME, TIMESTAMP
or INTERVAL value.
+
++
+NOTE: `_end 1, end 2_` cannot be NULL.
+
++
+The INTERVAL value advances or decrements date-time period.
+
++
+*Example*
+
++
+These two date-time periods overlap since TIMESTAMP '2019-11-02 01:00:00' is
less than one hour before TIMESTAMP '2019-11-02 02:00:01'.
+
++
+```
+SELECT 'Technical Writer' FROM DUAL
+WHERE
+(TIMESTAMP '2019-11-02 02:00:01', INTERVAL -'1' HOUR)
+OVERLAPS
+(TIMESTAMP '2019-11-02 01:00:00', INTERVAL '2' HOUR);
+
+(EXPR)
+----------------
+Technical Writer
+
+--- 1 row(s) selected.
+```
+
+[[considerations_for_overlaps]]
+==== Considerations for OVERLAPS
+
+* If two date-time periods are not instantaneous, they overlap when they share
a common period, that is, they must have one-second overlap for TIME/TIMESTAMP
or one-day overlap for DATE/TIMESTAMP.
+
++
+TIP: S1-E1 stands for `_(start 1, end 1)_`, S2-E2 stands for `_(start 2, end
2)_`, and so forth.
Review comment:
@DaveBirdsall Thanks Dave, your comment has been incorporated. I'll merge
this PR and update website.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 201068)
Time Spent: 1h (was: 50m)
> Add *OVERLAPS predicate* in Trafodion SQL Reference Manual
> ----------------------------------------------------------
>
> Key: TRAFODION-3277
> URL: https://issues.apache.org/jira/browse/TRAFODION-3277
> Project: Apache Trafodion
> Issue Type: Documentation
> Reporter: Liu Yu
> Assignee: Liu Yu
> Priority: Major
> Time Spent: 1h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)