SQL - TIME data type

1 - About

The time data type is a SQL data type that represents the time part of a instant. ie TIME contains the <datetime field>s HOUR, MINUTE, and SECOND.

3 - Syntax

The ANSI syntax is:


TIME [ <left paren> <time precision> <right paren> ] [ WITH TIME ZONE ]

  • If <time precision> is not specified, then 0 is implicit.
  • The length of a TIME is 8 positions plus the <time fractional seconds precision>, plus 1 position if the <time fractional seconds precision> is greater than 0.
  • The length of a TIME WITH TIME ZONE is 14 positions plus the <time fractional seconds precision> plus 1 position if the <time fractional seconds precision> is greater than 0.
  • TIME(P), where P is the number of digits in <seconds fraction>, if specified, and 0 otherwise.
  • The data type of a <time literal> that specifies <time zone interval> is TIME(P) WITH TIME ZONE, where P is the number of digits in <seconds fraction>, if specified, and 0 otherwise.
  • A TIME that does not specify WITH TIME ZONE has an implicit time zone equal to the local time zone for the SQL-session.

Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap