Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: *PLEASE* Help with an UPDATE query...Thanks
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
![]() |
![]() |