update total set total.marks= i1.marks1+i1.marks2+i1.marks3
from i1 join total on i1.id=total.id
where i1.id=’stud1′
Here,
- I am performing update operation
- Table names are i1 and total which has a common column id
- marks1 , marks2 , marks3 are columns in i1 table