Returns one field from a date value.
EXTRACT(extract_field FROM column_reference)
Description
Use EXTRACT to return the year, month, or day field from a DATE or TIMESTAMP column.
If the column used with the EXTRACT function contains a NULL value, the return value of EXTRACT will be NULL.
If the value is not NULL, EXTRACT returns the value for the specified element in the date,
expressed as a SMALLINT.The Extract_Field parameter may contain any one of
the specifiers: YEAR, MONTH, DAY, HOUR, MINUTE, or SECOND. The specifiers YEAR,MONTH, and DAY can only
be used with DATE and TIMESTAMP columns. The specifiers HOUR, MINUTE, and SECOND can only
be used with TIMESTAMP and TIME columns.