PL/SQL Extract

Oracle PL/SQL Extract Function

The Extract function extracts a value from a date or interval value.

The Extract Function syntax:

Valid extractions: YEAR, MONTH, DAY,HOUR, MINUTE,SECOND,TIMEZONE_HOUR, TIMEZONE_MINUTE, TIMEZONE_REGION, TIMEZONE_ABBR.

Example:

Select extract(YEAR FROM DATE '2008-04-21') From dual;
2008

Select extract(MONTH FROM DATE '2008-04-21') From dual;
4

Select extract(DAY FROM DATE '2008-04-21') From dual;
21