-
-
Notifications
You must be signed in to change notification settings - Fork 661
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for date operations with intervals in Oracle (#5262)
- Loading branch information
1 parent
595ad1f
commit 8e14e5a
Showing
3 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
select 1 | ||
from dual | ||
where sysdate > sysdate - interval '2' hour; | ||
|
||
select sysdate - interval '3' year | ||
from dual; | ||
|
||
select interval '2 3:04:11.333' day to second | ||
from dual; | ||
|
||
select 1 | ||
from dual | ||
where sysdate > to_date('01/01/1970', 'dd/mm/yyyy') + interval '600' month; | ||
|
||
select sysdate + interval '10' minute | ||
from dual; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
# YML test files are auto-generated from SQL files and should not be edited by | ||
# hand. To help enforce this, the "hash" field in the file must match a hash | ||
# computed by SQLFluff when running the tests. Please run | ||
# `python test/generate_parse_fixture_yml.py` to generate them after adding or | ||
# altering SQL files. | ||
_hash: 75c92164df465af4705b75019cbed005252cff6f553ba67ca21c682c1568788b | ||
file: | ||
- statement: | ||
select_statement: | ||
select_clause: | ||
keyword: select | ||
select_clause_element: | ||
numeric_literal: '1' | ||
from_clause: | ||
keyword: from | ||
from_expression: | ||
from_expression_element: | ||
table_expression: | ||
table_reference: | ||
naked_identifier: dual | ||
where_clause: | ||
keyword: where | ||
expression: | ||
- bare_function: sysdate | ||
- comparison_operator: | ||
raw_comparison_operator: '>' | ||
- bare_function: sysdate | ||
- binary_operator: '-' | ||
- keyword: interval | ||
- date_constructor_literal: "'2'" | ||
- keyword: hour | ||
- statement_terminator: ; | ||
- statement: | ||
select_statement: | ||
select_clause: | ||
keyword: select | ||
select_clause_element: | ||
expression: | ||
- bare_function: sysdate | ||
- binary_operator: '-' | ||
- keyword: interval | ||
- date_constructor_literal: "'3'" | ||
- keyword: year | ||
from_clause: | ||
keyword: from | ||
from_expression: | ||
from_expression_element: | ||
table_expression: | ||
table_reference: | ||
naked_identifier: dual | ||
- statement_terminator: ; | ||
- statement: | ||
select_statement: | ||
select_clause: | ||
keyword: select | ||
select_clause_element: | ||
- keyword: interval | ||
- date_constructor_literal: "'2 3:04:11.333'" | ||
- keyword: day | ||
- keyword: to | ||
- keyword: second | ||
from_clause: | ||
keyword: from | ||
from_expression: | ||
from_expression_element: | ||
table_expression: | ||
table_reference: | ||
naked_identifier: dual | ||
- statement_terminator: ; | ||
- statement: | ||
select_statement: | ||
select_clause: | ||
keyword: select | ||
select_clause_element: | ||
numeric_literal: '1' | ||
from_clause: | ||
keyword: from | ||
from_expression: | ||
from_expression_element: | ||
table_expression: | ||
table_reference: | ||
naked_identifier: dual | ||
where_clause: | ||
keyword: where | ||
expression: | ||
- bare_function: sysdate | ||
- comparison_operator: | ||
raw_comparison_operator: '>' | ||
- function: | ||
function_name: | ||
function_name_identifier: to_date | ||
bracketed: | ||
- start_bracket: ( | ||
- expression: | ||
quoted_literal: "'01/01/1970'" | ||
- comma: ',' | ||
- expression: | ||
quoted_literal: "'dd/mm/yyyy'" | ||
- end_bracket: ) | ||
- binary_operator: + | ||
- keyword: interval | ||
- date_constructor_literal: "'600'" | ||
- keyword: month | ||
- statement_terminator: ; | ||
- statement: | ||
select_statement: | ||
select_clause: | ||
keyword: select | ||
select_clause_element: | ||
expression: | ||
- bare_function: sysdate | ||
- binary_operator: + | ||
- keyword: interval | ||
- date_constructor_literal: "'10'" | ||
- keyword: minute | ||
from_clause: | ||
keyword: from | ||
from_expression: | ||
from_expression_element: | ||
table_expression: | ||
table_reference: | ||
naked_identifier: dual | ||
- statement_terminator: ; |