SQL MONTH()不工作

时间:2017-06-19 15:57:06

标签: sql oracle

我试图选择5月份录用的人但我的(MONTH(HIRE_DATE)= 05)无法工作

SELECT EMPLOYEE_ID AS "Employee Number", LAST_NAME ||', '|| FIRST_NAME AS 
"Full Name", JOB_ID, '[' || TO_CHAR(HIRE_DATE, 'Month fmddth "of" YYYY') ||']' AS "Hire Date"
FROM EMPLOYEES
WHERE (HIRE_DATE NOT BETWEEN TO_DATE('01/01/1994','DD/MM/YYYY') AND 
TO_DATE('31/12/1995','DD/MM/YYYY')) AND
(MONTH(HIRE_DATE) = 05)

1 个答案:

答案 0 :(得分:1)

Oracle中没有MONTH()函数。

to_char(hire_date, 'mm') = '05'extract (month from hiredate) = 5都应该有用。