Here is what SQL standard 2003 say about interval literal:
<interval literal> ::= INTERVAL [ <sign> ] <interval string> <interval
qualifier>
<interval string> ::= <quote> <unquoted interval string> <quote>
<unquoted interval string> ::=
[ <sign> ] { <year-month literal> | <day-time literal> }
<year-month literal> ::=
<years value> [ <minus sign> <months value> ]
| <months value>
<day-time literal> ::=
<day-time interval>
| <time interval>
Looks like sign could appear before the quote and inside the quote.
The minus sign could even appear before months value.
On Thu, Oct 22, 2015 at 10:26 PM, Julian Hyde <[email protected]> wrote:
> First of all, look up interval laterals in the SQL standard and find out
> whether it's even valid.
>
> Julian
>
>> On Oct 22, 2015, at 21:49, Hsuan Yi Chu <[email protected]> wrote:
>>
>> Hi All,
>> I am trying to resolve CALCITE-922, (interval error, coming from attempting
>> to get value of Interval Type).
>>
>> However, I found another issue regarding the "sign (i.e., + or -)" of
>> Interval type (see CALCITE-928). To resolve it, can somebody tell me what
>> this means:
>>
>> "INTERVAL -'-1' YEAR"
>>
>> Do the two negative signs cancel each other?