EXTRACT(extract-field FROM extract-source)

Returns the extract-field portion of the extract-source. The extract-source argument is a date or timestamp expression.

The extract-field argument can be one of the following keywords:

YEAR
MONTH
DAY
HOUR
MINUTE
SECOND

 

Example:

SELECT EXTRACT(YEAR FROM {d '2001-09-13'}) returns 2001