Interval
The family of data types representing time and date intervals. The resulting types of the INTERVAL operator.
Structure:
- Time interval as an unsigned integer value.
- Type of an interval.
Supported interval types:
NANOSECOND
MICROSECOND
MILLISECOND
SECOND
MINUTE
HOUR
DAY
WEEK
MONTH
QUARTER
YEAR
For each interval type, there is a separate data type. For example, the DAY
interval corresponds to the IntervalDay
data type:
Usage Remarks
You can use Interval
-type values in arithmetical operations with Date and DateTime-type values. For example, you can add 4 days to the current time:
Also it is possible to use multiple intervals simultaneously:
And to compare values with different intervals:
See Also
- INTERVAL operator
- toInterval type conversion functions