select a as average,name
from (select avg(marks) as a,name
from marks,student where rollno=roll group by marks.roll);
ERROR 1248 (42000): Every derived table must have its own alias
I know the correction. Just want to know why I have to use the alias?
select a as average,name
from (select avg(marks) as a,name
from marks,student where rollno=roll group by marks.roll)xxx;