EXTRACT function

EXTRACT( fm FROM e) gets value from a timestamp; fm is a format; e is a timestamp expression.

Format and the EXTRACT Function

KeywordDATETIME STAMPTIME STAMP WITH TIME ZONETIME STAMP WITH LOCAL TIME ZONEINTERVAL YEAR TO MONTHINTERVAL DAY TO SECOND
YEARXXXXX-
MONTHXXXXX-
DAYXXXX-X
HOUR-XXX-X
MINUTE-XXX-X
SECOND-XXX-X
TIMEZONE_HOUR--Xlocal session time zone data--
TIMEZONE_MINUTE--Xlocal session time zone data--
TIMEZONE_REGION--Xlocal session time zone data--
TIMEZONE_ABBR--Xlocal session time zone data--

SELECT EXTRACT(MINUTE FROM TO_TIMESTAMP('2012-12-11 12:13:14','RRRR-MM-DD HH24:MI:SS')) "Minute"
FROM   DUAL;
Home »
Oracle »
Date functions » 

Related: