what is the best way to make multiple operations in one statement in update i want for example to update field column of nr3 table.
Create table nr1
(
id int,
price int,
price2 int,
PRIMARY KEY (id)
);
create table nr2
(id int,
salary int
PRIMARY KEY (id)
);
create table nr3
(id int,
id1 int,
id2 int,
value int,
field int,
PRIMARY KEY (id),
FOREIGN KEY (id1) REFERENCES nr1(id),
FOREIGN KEY (id2) REFERENCES nr2(id)
);
and for example i want to make operation
nr3.field= ((nr1.price+nr1.price2)* nr2.salary)/nr3.value;
How to make it in the best way, i need to have some template, because i think i don't get it, it's possible to make it in one UPDATE
or i need to make some other "temporary" columns?