Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.34.0
Description
From SQL standard we can found:
ISO/IEC 9075-2:1999 (E) 6.17 <numeric value function>: If <extract field> is a <primary datetime field>, then the result is the value of the datetime field identified by that <primary datetime field> and has the same sign as the <extract source>.
other data bases are follow this rule, i.e. :
SELECT EXTRACT (MONTH FROM INTERVAL '-1' MONTH) FROM DUAL;
returns: -1
and ** the other one:
SELECT EXTRACT(MONTH FROM INTERVAL '-1 MONTHS')
return the same result,
while calcite:
SELECT EXTRACT(MONTH FROM INTERVAL -1 MONTHS) AS extracted;
< +---------+ < | -1 | < +---------+ --- > +-----------+ > | 11 | > +-----------+
Attachments
Issue Links
- links to