我试图选择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)
答案 0 :(得分:1)
Oracle中没有MONTH()
函数。
to_char(hire_date, 'mm') = '05'
和extract (month from hiredate) = 5
都应该有用。