This Oracle tutorial explains how to use the Oracle/PLSQL EXTRACT function with syntax and examples.
The Oracle/PLSQL EXTRACT function extracts a value from a date or interval value.
The syntax for the EXTRACT function in Oracle/PLSQL is:
The EXTRACT function returns a numeric value when the following parameters are provided: YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, TIMEZONE_HOUR, TIMEZONE_MINUTE, TIMEZONE_REGION, TIMEZONE_MINUTE. The EXTRACT function returns a VARCHAR2 when TIMEZONE_REGION or TIMEZONE_ABBR parameters are provided (because the time zone name or abbreviation information is returned).
The EXTRACT function can be used in the following versions of Oracle/PLSQL:
Let's look at some Oracle EXTRACT function examples and explore how to use the EXTRACT function in Oracle/PLSQL.
For example: