The EXTRACT function extracts fields (or calculates values)
from datetime values and intervals.
The result is INTEGER for YEAR, MONTH, DAY, HOUR, and MINUTE extracts, but FLOAT for SECOND extracts. If the SourceDate is NULL, the result is NULL regardless of the type of extract.
EXTRACT extracts individual fields from datetime values and intervals. You can extract a field only if it is present in the datetime value specified in the second parameter. Either a parse-time or a runtime error is generated if the requested field does not exist within the data type.
EXTRACT(YEAR FROM CURRENT_DATE)and
EXTRACT(HOUR FROM LOCAL_TIMEZONE)both work without error, but
EXTRACT(DAY FROM CURRENT_TIME)fails.