SQL>
SQL>
SQL> --EXTRACT(): get the hour, minute, and second from a TIMESTAMP returned by TO_TIMESTAMP():
SQL>
SQL> SELECT
2 EXTRACT(HOUR FROM TO_TIMESTAMP('01-JAN-2005 19:15:26',
3 'DD-MON-YYYY HH24:MI:SS')) AS HOUR,
4 EXTRACT(MINUTE FROM TO_TIMESTAMP('01-JAN-2005 19:15:26',
5 'DD-MON-YYYY HH24:MI:SS')) AS MINUTE,
6 EXTRACT(SECOND FROM TO_TIMESTAMP('01-JAN-2005 19:15:26',
7 'DD-MON-YYYY HH24:MI:SS')) AS SECOND
8 FROM dual;
HOUR MINUTE SECOND
---------- ---------- ----------
19 15 26
SQL>
|