I want to calculate letter grade by using average column.
I tried to do it with this code:
UPDATE students
SET letter_grade='BA'
WHERE (average- (select AVG(average)from students )) > 20
AND (average-(select AVG(average)from students)) < 25;
But it gives the following error: you cant specify target table 'students' for update if FROM clause.
It seems mysql does not allow update a table by using select from same table. How can I solve this problem?