Book Contents

Book Index

Next Topic

Home

EXTRACT

The EXTRACT function retrieves subfields such as year or hour from date/time values and returns values of type double precision. It is primarily intended for computational processing rather than formatting date/time values for display.

Syntax

EXTRACT (field FROM source)

Semantics

field

is an identifier or string that selects what field to extract from the source value.

source

an expression of type DATE, TIMESTAMP, TIME, or INTERVAL. (Expressions of type DATE are cast to TIMESTAMP.)