I need to find the age of student when he was readmitted to a class. Now to do this I have one table student_history hence first needed to retrieve the "admin_date" admission date from student history when student status equals to 'RE-ADMIN're admitted. And then to check if admin_date is greater than admin_date of last Readmission 'RE-ADMIN' or Completed 'COMP' in records. Now the query is not working as it should be and running into different errors.
SELECT
s.admin_date
FROM
student_history s
WHERE
student_st = 'RE-ADMIN'
AND
s.admin_date > (
SELECT
s.admin_date
FROM
s
WHERE
student_st IN('RE-ADMIN','COMP')
)
couple of similar links researched.