Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL. Correlated UPDATE problem.
try this
statement:
UPDATE
customers
SET
cusname = (SELECT Cname FROM Customers_newinfo
WHERE Customers_newinfo.Cno = customers.Cusno)and exist
WHERE Customers_newinfo.Cno = customers.Cusno);
Bye!
Ivan Nilsson <dumb_at_nospam.com> wrote in message news:Olbm4.4510$jg4.9133_at_nntpserver.swip.net... This is a simplified version of my problem. I have these two tables
Customers
Cusno, cusname
1, Johhny 2, Amanda 3, Anthony 4, Elsabeth
Customers_newinfo
Cno, Cname
2, Amanda Smith
3, Andy Welsh
I wish to update Customers with the data from Customers_newinfo using one
UPDATE statement.
Thus, customer 2 in Customer shall have the name changed to Amanda Smith,
and Customer 3 to Andy Welsh.
My problem is to make the UPDATE-statement correlate the customer numbers from the two tables.
Anyone who knows how to do this?
/TIA Received on Wed Feb 09 2000 - 03:10:07 CST
![]() |
![]() |