G'day Atrix,

At 16:54 13/10/02 -0700, you wrote:
>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? (:


Here are some code snippets from my NoteTab Pro snippet insert clipbook
that should show you how to do it.

H="UPDATE - 2 table simple"
UPDATE ^?[Table 1 name] SET +
   ^?[Table 1 col to update] = t2.^?[Table 2 data col] +
   FROM ^?[Table 1 name] t1,^?[Table 2 name] t2 +
   WHERE t2.^?[Table 2 linking col] = t1.^?[Table 1 linking col] +
   AND

H="UPDATE - 2 table sum"
UPDATE ^?[Table 1 name] SET +
   ^?[Table 1 col to update] = (t1.^?[Table 1 col to update] + t2.^?[Table 
2 col to add]) +
   FROM ^?[Table 1 name] t1,^?[Table 2 name] t2 +
   WHERE t2.^?[Table 2 linking col] = t1.^?[Table 1 linking col] +
   AND




Warmest regards,


Tom Grimshaw
coy:    Just For You Software
tel:    612 9552 3311
fax:    612 9566 2164
mobile: 0414 675 903

post:   PO Box 470  Glebe  NSW  2037  Australia
street: 3/66 Wentworth Park Rd  Glebe  NSW  2037

email:  [EMAIL PROTECTED]
web: www.just4usoftware.com.au

"... the control of impulse -- is the first principle of civilization."-- 
Will Durant,
Pulitzer Prize winning philosopher, writer and historian

the most needed product in the world can be found at
www.thewaytohappiness.org

This email and any files transmitted with it are confidential to the 
intended recipient and may be privileged. If you have received this email 
inadvertently or you are not the intended recipient, you may not 
disseminate, distribute, copy or in any way rely on it. Further, you should 
notify the sender immediately and delete the email from your computer. 
Whilst we have taken precautions to alert us to the presence of computer 
viruses, we cannot guarantee that this email and any files transmitted with 
it are free from such viruses.

================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/

Reply via email to