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: Anon <pjbump_at_i1.net>
Date: 1997/09/20
Message-ID: <01bcc5ea$abf4d660$d33ae6cf@default>#1/1

Try this:
UPDATE A
SET A.SomeField =
(SELECT B.SomeField
  FROM B, A
 WHERE B.ID = A.ID)
WHERE A.ID in ('list of values');

-- 
Phillip Bump
Senior Principal Consultant
Oracle Consulting
----------------------------------------------------------------------------
-----------------------------------------------------------------------
The opinions expressed are my own and do not necessarily reflect those of
Oracle Corporation

NNOOR <Nnoor_at_cris.com> wrote in article
<5vuchv$s6o_at_examiner.concentric.net>...

>
> 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 = 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 = B.someField;
>
> I can't seem to figure out how to combine the two in one query (or
> nested sub-queries). Is it possible at all? If not, what would be the
> best way, in your opinion, to do this?
>
> Thanks very much for your help!!!
>
> Regards,
> Nasir (NNoor_at_cris.com)
>
Received on Sat Sep 20 1997 - 00:00:00 CDT

Original text of this message

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