Extract Function extracts a value from a date or interval value.
Syntax:
EXTRACT (
{ YEAR | MONTH | DAY | HOUR | MINUTE | SECOND }
|{ TIMEZONE_HOUR | TIMEZONE_MINUTE }
|{ TIMEZONE_REGION |TIMEZONE_ABBR }
FROM { date_value |interval_value } )
Can only Exctract YEAR, MONTH and DAY from date.
Eg:
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
No comments:
Post a Comment