0
In creating my table I want a column in D table to be a sum of two columns from two different tables. How do I do it.
I feel it's a trigger but how do I implement due aggregate functions and reference do tables
1 Odpowiedź
0
If you want the sum to happen for every record insert into the other two tables, then you definitely a trigger.
Otherwise, if it is a one time operation, then write:
insert into D
( select t1.a, t2.b, t1.a + t2.b
from t1, t2
where t1.col = t2.col)