NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
I-23
INTERVAL Literals
The start-field you specify must precede the end-field you specify in the list
of field name, and only end-field can use the precision option on FRACTION.
years
is an unsigned integer that specifies a number of years. It can have up to 18 digits,
minus the number of digits in the months field, if any. Negative values are
allowed, with the minus sign inside the quotes.
months
is an unsigned integer that specifies a number of months. Used as a starting field, it
can have up to 18 digits; as a nonstarting field, it must be in the range 0 through 11.
Negative values are allowed, with the minus sign inside the quotes.
days
is an unsigned integer that specifies a number of days. It can have up to 18 digits,
minus the number of digits in the other fields of the INTERVAL literal. Negative
values are allowed, with the minus sign inside the quotes.
hours
is an unsigned integer that specifies a number of hours. Used as a starting field, it
can have up to 18 digits, minus the number of digits in the other fields of the
INTERVAL literal; as a nonstarting field, it must be in the range 0 through 23.
Negative values are allowed, with the minus sign inside the quotes.
y-m is:
{ years[-months] }
{ months }
d-t is:
{ days:hours[:minutes[:seconds[.fraction]]] }
{ hours[:minutes[:seconds[.fraction]]] }
{ minutes[:seconds[.fraction]] }
{ seconds[.fraction] }
{ fraction }
start-field and end-field are:
{ YEAR }
{ MONTH }
{ DAY }
{ HOUR }
{ MINUTE }
{ SECOND }
{ FRACTION [ (precision) ] }