If I had two tables like:
first second
a | b | c b | d
---------- -----
1 | 2 | 2 | 4
2 | 3 | 3 | 5
and I wanted to update table first
so that it writes column c
to be column a
* column d
, how would I do this in a single query?
I'd want something like these two statements combined:
SELECT * FROM first LEFT OUTER JOIN second on first.b=second.b
and
UPDATE first SET c = (b * d)