What I need is a sql for the following I have tables
P which has columns PID, X, DX (PID is PK)
E which as columns EID, PID, X (EID is PK)
Table E has multiple entries for each PID
The statement which DOES NOT work was
update P,E set P.X=P.X+E.X, P.DX = E.X where P.PID = E.PID
I think it should be an update P set P.X = ?, P.DX = ? select( Sum(X) from E group by PID)
but I don't know how to take the output of the select and join it with P and set two values on each row;
Any help would be appreciated!