Download Informix Guide to SQL: Syntax, Version 6.0

Transcript
INTERVAL Field Qualifier
f-precision
is the maximum number of digits used in the fraction field.
The default is three; the maximum is five.
precision
is the number of digits in the largest number of months,
days, hours, or minutes that the interval can hold. The
default is two; the maximum is nine.
y- precision
is the number of digits in the largest number of years that the
interval can hold. The default is four; the maximum is nine.
Usage
The examples in this section show INTERVAL data types that are of the type
YEAR TO MONTH types. The first example can hold an interval of up to 999
years and 11 months, because it gives 3 as the precision of the year field. The
second example uses the default precision on the year field, so it can hold an
interval of up to 9,999 years and 11 months.
YEAR (3) TO MONTH
YEAR TO MONTH
When you want a value to contain only one field, the first and last qualifiers
are the same. For example, an interval of whole years is qualified as YEAR TO
YEAR or YEAR (5) TO YEAR, for an interval of up to 99,999 years.
The following examples show several forms of INTERVAL qualifiers:
YEAR(5) TO MONTH
DAY (5) TO FRACTION(2)
DAY TO DAY
FRACTION TO FRACTION (4)
References
In the Informix Guide to SQL: Reference, for information about using INTERVAL
data in arithmetic and relational operations, see Chapter 3.
1-486 Syntax