Update script [message #373092] |
Tue, 27 March 2001 06:37 |
sonia
Messages: 22 Registered: March 2001
|
Junior Member |
|
|
I am trying to update a column in a table which needs to reference another table column to only update certain clients. I have written this script which works in SQL Server (my background) but will not run on Oracle with the message command not properly ended. What do I need to change?
update CUSTOMER
set VALUE= VALUE/0.2
from CUSTOMER a, ACCOUNT b
where a.id = b.id
and b.code = 'S'
|
|
|
Re: Update script [message #373094 is a reply to message #373092] |
Tue, 27 March 2001 07:09 |
Prem
Messages: 79 Registered: August 1998
|
Member |
|
|
Sonia,
You cannot perform an update statement with a join because the update can work on only one table. Try this instead.
update CUSTOMERS
set VALUE = VALUE / 0.2
where ID in (select ID from ACCOUNT where CODE='S');
hth
Prem :)
|
|
|
|