SQL/MX 2.x Reference Manual (G06.24+, H06.03+)
SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual—523725-004
6-30
Interval Data Types
Interval Data Types
Considerations for Interval Data Types
SQL/MP Considerations for Interval Data Types
Values of interval data type represent durations of time in year-month units (years and 
months) or in day-time units (days, hours, minutes, seconds, and fractions of a 
second). 
INTERVAL { start-field TO end-field | single-field }
specifies a column that represents a duration of time as either a year-month or 
day-time range or a single-field. The optional sign indicates if this is a positive or 
negative integer. If you omit the sign, it defaults to positive.
If the interval is specified as a range, the start-field and end-field must be 
in one of these categories: 
{YEAR | MONTH | DAY | HOUR | MINUTE} [(leading-precision)] 
specifies the start-field. A start-field can have a leading-precision 
up to 18 digits (the maximum depends on the number of fields in the interval). The 
leading-precision is the number of digits allowed in the start-field. The 
default for leading-precision is 2.
YEAR | MONTH | DAY | HOUR | MINUTE | SECOND [(fractional- 
 precision)] 
specifies the end-field. If the end-field is SECOND, it can have a 
fractional-precision up to 6 digits. The fractional-precision is the 
number of digits of precision after the decimal point. The default for 
fractional-precision is 6.
start-field | SECOND [(leading-precision, 
 fractional-precision)] 
specifies the single-field. If the single-field is SECOND, the 
leading-precision is the number of digits of precision before the decimal 
interval-type is: 
INTERVAL { start-field TO end-field | single-field } 
start-field is: 
 {YEAR | MONTH | DAY | HOUR | MINUTE} [(leading-precision)] 
end-field is:
 YEAR | MONTH | DAY | HOUR | MINUTE | SECOND 
 [(fractional-precision)] 
single-field is: 
 start-field | SECOND [(leading-precision, 
 fractional-precision)] 










