Table of Contents

Search

  1. About the Data Vault SQL Reference
  2. Introduction to SQL Reference for Informatica Data Vault
  3. Date and Time Arithmetic
  4. WHERE Clauses
  5. UNION Operator
  6. Parameterized Query
  7. Functions

Data Vault SQL Reference

Data Vault SQL Reference

Intervals

Intervals

Subtracting one temporal type from another of the same type results in an
interval
. There are three types of intervals: date, time, and timestamp. A date interval is characterized by an integral number of
days
, ranging between -99,999,999 and 99,999,999 inclusive. A time interval is characterized by an integral number of
seconds
, ranging between -999,999 and 999,999 inclusive. And a timestamp interval is represented by a decimal number of
seconds
, anywhere between +/-99,999,999,999,999.999999 inclusive. Note that a negative interval is produced if the value being subtracted is greater than the value from which it is being subtracted. "Greater than", in the case of temporal intervals, means "more recent".
Intervals can be involved in arithmetic expressions involving other intervals or labeled durations (see below), date/time datatypes, or numeric expressions. If required, a date/time interval can be converted to an integer value using the INTEGER casting function.
The following table summarizes characteristics of these intervals:
Operation
Interval Type
Size
Unit
<DATE> – <DATE>
date interval
DEC (8,0)
days
<TIME> – <TIME>
time interval
DEC (6,0)
seconds
<TIMESTAMP> – <TIMESTAMP>
timestamp interval
DEC (20,6)
seconds

0 COMMENTS

We’d like to hear from you!