Oracle/PLSQL: Extract Function:
[url]http://www.techonthenet.com/oracle/functions/extract.php[/url]
[url]extract [Oracle SQL]:[/url]
[url]http://www.adp-gmbh.ch/ora/sql/extract.html[/url]
[url]http://www.cnblogs.com/ruanbl/archive/2008/02/29/1086398.html[/url]
[quote]
In Oracle/PLSQL, the extract function extracts a value from a date or interval value.
The syntax for the extract function is:
EXTRACT (
{ YEAR | MONTH | DAY | HOUR | MINUTE | SECOND }
| { TIMEZONE_HOUR | TIMEZONE_MINUTE }
| { TIMEZONE_REGION | TIMEZONE_ABBR }
FROM { date_value | interval_value } )
You can only extract YEAR, MONTH, and DAY from a DATE.
You can only extract TIMEZONE_HOUR and TIMEZONE_MINUTE from a timestamp with a time zone datatype.
Applies To:
Oracle 9i, Oracle 10g, Oracle 11g
For example:
extract(YEAR FROM DATE '2003-08-22') would return 2003
extract(MONTH FROM DATE '2003-08-22') would return 8
extract(DAY FROM DATE '2003-08-22') would return 22
[/quote]
[url]http://www.techonthenet.com/oracle/functions/extract.php[/url]
[url]extract [Oracle SQL]:[/url]
[url]http://www.adp-gmbh.ch/ora/sql/extract.html[/url]
[url]http://www.cnblogs.com/ruanbl/archive/2008/02/29/1086398.html[/url]
[quote]
In Oracle/PLSQL, the extract function extracts a value from a date or interval value.
The syntax for the extract function is:
EXTRACT (
{ YEAR | MONTH | DAY | HOUR | MINUTE | SECOND }
| { TIMEZONE_HOUR | TIMEZONE_MINUTE }
| { TIMEZONE_REGION | TIMEZONE_ABBR }
FROM { date_value | interval_value } )
You can only extract YEAR, MONTH, and DAY from a DATE.
You can only extract TIMEZONE_HOUR and TIMEZONE_MINUTE from a timestamp with a time zone datatype.
Applies To:
Oracle 9i, Oracle 10g, Oracle 11g
For example:
extract(YEAR FROM DATE '2003-08-22') would return 2003
extract(MONTH FROM DATE '2003-08-22') would return 8
extract(DAY FROM DATE '2003-08-22') would return 22
[/quote]