using subqueries to obtain sorted data

Well because oracle actually see your code like this:

SELECT student.first_name, student.last_name
FROM student 
WHERE student.student_id IN (
SELECT enrollment.student_id FROM 
enrollment ) --where the ) should be!!!
ORDER BY enrollment.enroll_date  --and this line just mess up the code delete this. 

the reason why this happen is in the subquery you try to order by. Just get rid of that order by or use it outside the subquery and the error should not occur anymore.

Beside when you use IN there is no meaning to use order by in that subquery.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top