Atrix,
 
You can try:-
 
UPDATE Accounts SET Budget = (T2.Budget) +
  FROM Accounts T1, +
  NewData T2 +
  WHERE T1.Account = T2.Account
 
It works in 4.5++ with the () around the value.
 
Regards
Clive Williams
CRW Services
Silverdale NSW 2752
Australia
 
----- Original Message -----
Sent: Monday, October 14, 2002 9:54 AM
Subject: sql query

hello again, im trying to do another sql statement but i've been told its not possible to do it and wanted to confirm that.
 
i basicly have 2 tables,  the first table called NewData has account and budget.  The second table is Accounts and has account, budget and some other columns that we need to preserve.  What im trying to do is update Accounts with the new budgets from NewData.   If in NewData there is account 3 and budget $5.00 then i need that to update account 3 in Accounts to have a budget of $5.00.  There are a few thousand of these entires in NewData and i was hoping there was some way to do it without a cursor loop.  Something like:
 
update accounts set budget=t2.budget from accounts t1,NewData t2 where t1.account=t2.account
 
what i heard exactly was "in standard SQL, multi-table update does not exist."
 
any ideas? (:

Reply via email to