At 11:25 AM 9/12/2010, John Engwer wrote:
Is it possible to use the update command to update TABLE1
using the sum of values from TABLE2?
Such asÂ… UPDATE TABLE1 SET InStockQty = (SUM)T2.OnHand
FROM TABLE1 T1,TABLE2 T2 WHE T1.MfgStyle = T2.StockNo
John,
Here's how to use a correlational UPDATE command in R:BASE:
Goal:
Update TableA (TableAColumn) from the SUM of values in TableB (TableBColumn)
Assumptions:
Both columns in each table are of similar data
type, such as, BIGNUM, CURRENCY,
DOUBLE, INTEGER, NUMERIC, or REAL.
Command:
SET FEEDBACK ON
UPDATE TableA SET TableAColumn = (SUM(TableBColumn)) +
FROM TableB,TableA WHERE TableA.KeyColumn = TableB.KeyColumn
SET FEEDBACK OFF
That's all there is to it!
Very Best R:egards,
Razzak.