•SELECT EXTRACT(YEAR FROM SYSDATE) FROM DUAL; return Current Year
•SELECT EXTRACT(MONTH FROM SYSDATE) FROM DUAL; return Current Month
•SELECT EXTRACT(DAY FROM SYSDATE) FROM DUAL; return Current Day
•SELECT EXTRACT(HOUR FROM SYSDATE) FROM DUAL;Error
Correct:SELECT EXTRACT(HOUR FROM TIMESTAMP '2005-10-10 10:10:10') FROM DUAL;
•SELECT EXTRACT(MINUTE FROM SYSDATE) FROM DUAL;Error
Correct:SELECT EXTRACT(MINUTE FROM TIMESTAMP '2005-10-10 10:10:10') FROM DUAL;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10356975/viewspace-680332/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10356975/viewspace-680332/