I am trying to select those faculty rows which have the same month of birth as that of students, but this code doesn't seem to work. "SQL Error: ORA-00904: "MONTH": invalid identifier" is the error being displayed.
SELECT STUDENT.FIRSTNAME, STUDENT.DOB, FACULTY.FIRSTNAME, FACULTY.DOB
FROM STUDENT, FACULTY
HAVING MONTH(STUDENT.DOB) = MONTH(FACULTY.DOB);
You can Try this:
SELECT STUDENT.FIRSTNAME, STUDENT.DOB, FACULTY.FIRSTNAME, FACULTY.DOB
FROM STUDENT, FACULTY
where
extract(month from STUDENT.DOB)=extract(month from FACULTY.DOB)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.