EXTRACT allows you to extract parts of a date expression.

You may want to extract the year from a date string, or minute value in a date-time expression.

Valid extractions include YEAR, MONTH, DAY,HOUR, MINUTE,SECOND,TIMEZONE_HOUR, TIMEZONE_MINUTE, TIMEZONE_REGION and TIMEZONE_ABBR

Example:

SELECT EXTRACT(YEAR FROM DATE ‘2004-10-12’) as RESULT FROM DUAL;

RESULT
—————-
2004

EXTRACT – Oracle SQL Function
Tagged on: