Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: updates in sqlplus
Mike Baldock wrote:
> Hi
>
> In sqlplus I would like to update 2 fields which are identical in two
> tables
>
> Simplified
> Table Trial has fields id,yr,no,trialid
> Table Trialloc has fields id,yr,no,trialid,location
>
> The basis of thses tables are plants in a row of a research trial I
> want
> to change the name of the trial where all the locations are like 'A%'
>
> I can easily update the trial name in the table "trialloc"
>
> update trialloc
> set trialid='NEWTRIAL"
> where location like 'A%'
>
> How can I also update trialid in the table "trial" at the same time?
>
> thanks for any help
>
> Mike Baldock
>
> Mike.Balodck_at_hri.ac.uk
Dear Mike,
I don't have any way of testing this before I send it to you, but it
looks like this might work.
Issue this command before you issue the one you already gave.
update trial
set trialid = 'NEWTRIAL'
where id in
( select id
from trialloc
where location like 'A%'
) ;
Received on Sat Dec 06 1997 - 00:00:00 CST
![]() |
![]() |