How to: |
The EXTRACT function can be used to obtain the year, month, day of month, hour, minute, second, millisecond, or microsecond component of a date, time, or timestamp value.
EXTRACT(field FROM arg)
where:
Date, time, or timestamp
Is the input argument.
Is the datetime field of interest. Possible values are YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, MILLISECOND and MICROSECOND.
This function returns an integer value.
Note:
EXTRACT returns the components of a date, time, or timestamp. This example,
EXTRACT(YEAR FROM '2000-01-01')
returns 2000.
This example,
EXTRACT(HOUR FROM '11:22:33')
returns 11.
This example,
EXTRACT(MICROSECOND FROM '2000-01-01 11:22:33.456789')
returns 456,789.
iWay Software |