Performing addition of 3 values of a joined query

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,

  1. I am performing update operation
  2. Table names are i1 and total which has a common column id
  3. marks1 , marks2 , marks3 are columns in i1 table

Leave a comment