SQL - Interval

1 - About

time duration is known as interval in SQL.

3 - Syntax

An SQL interval data type descriptor contains:

  • the name of the interval data type (INTERVAL);
  • an indication of whether the interval data type is :
    • a year-month interval. It can include only YEAR, MONTH field and not both field are required.
    • or a day-time interval. It can include any fields other than YEAR or MONTH.
  • the <interval qualifier> that describes the precision of the interval data type.

4 - Operations


Datetime  -  Datetime  = Interval
Datetime  + or -  Interval  = Datetime
Interval + Datetime = Datetime
Interval + or - Interval = Interval
Interval * or / Numeric = Interval
Numeric * Interval = Interval


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap