Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: *PLEASE* Help with an UPDATE query...Thanks

Re: *PLEASE* Help with an UPDATE query...Thanks

From: António Paulo Maio <apmaio_at_mail.REMOVETHIStelepac.pt>
Date: 1997/09/19
Message-ID: <3422E6EE.B7437151@mail.REMOVETHIStelepac.pt>#1/1

NNOOR wrote:
> =
 

> Hi,
> I have two tables--call them A and B.
> I want to update certain fields in A from values in table B based
> on a selection criteria.
> =
 

> The "select" portion would be like:
> SELECT * from A
> WHERE A.ID =3D B.ID AND A.ID in ('<a list of values>');
> =
 

> And then based on above select, I want to update table A:
> UPDATE A
> SET A.someField =3D B.someField;
> =

I think that what you want is this:

update a set a.somefield=3D (select b.somefield where b.id=3D a.id) where a.id in ('list of values')

which may be somewhat innefficient but should work.

Ant=F3nio Maio Received on Fri Sep 19 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US