Skip
Arish's avatar

286. UPDATE with Subquery


Subquery in UPDATE

sql
1UPDATE students 
2SET grade = 'A'
3WHERE marks > (SELECT AVG(marks) FROM students);

Update based on calculated value.