Oracle extract()?????????????????????????????????????????Oracle extract??????????
??????
select extract(year from date '2011-05-17') year from dual;?????????????????
2011??????
select extract(month from date '2011-05-17') month from dual;?????????????????
5??????????
select extract(day from dt2-dt1) day, extract(hour from dt2-dt1) hour, extract(minute from dt2-dt1) minute, extract(second from dt2-dt1) second from (select to_timestamp('2011-02-04 15:07:00', 'yyyy-mm-dd hh24:mi:ss') dt1, to_timestamp('2011-05-17 19:08:46', 'yyyy-mm-dd hh24:mi:ss') dt2 from dual)???????????????????????
102 4 1 46????????
select extract(year from systimestamp) year, extract(month from systimestamp) month, extract(day from systimestamp) day, extract(minute from systimestamp) minute, extract(second from systimestamp) second, extract(timezone_hour from systimestamp) th, extract(timezone_minute from systimestamp) tm, extract(timezone_region from systimestamp) tr, extract(timezone_abbr from systimestamp) ta from dual;???????????????????????
2011 5 17 7 14.843 8 0 UNKNOWN UNK