I have the following query
SELECT * FROM(
(select * from `responses` a order by id, exam, question)
left JOIN
(select max(exam) as maxexam from responses b )
on a.exam <= b.maxexam
and id > 2) c
I get the following error message
Every derived table must have its own alias
If you are using join condition
on a.exam <= b.maxexam and id > 2then uou need to give aliasaandbto the two subqueries: