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

Home -> Community -> Usenet -> c.d.o.tools -> Difficult Correlated Update Query

Difficult Correlated Update Query

From: David Chasteen <david_chasteen_at_mindspring.com>
Date: Wed, 29 Nov 2000 20:55:11 -0500
Message-ID: <904buf$m9p$1@slb3.atl.mindspring.net>

How do I update a column in one table with the column value in another table and have it correlated to the same key. For example:

Table A
Akey Col1

   1          a
   2          b
   3          c

Table B
Bkey Col2

   1         x
   2         y
   3         z

I tried:

update A

      set Col1 = (select Col2 from B where Akey = Bkey)

and
update A

      set Col1 = (select Col2 from B where Akey = Bkey)   where Akey = Bkey

and

update A

      set Col1 = (select Col2 from B)
  where Akey = Bkey

I still haven't figured it out. Does anyone know?

Thanks. Received on Wed Nov 29 2000 - 19:55:11 CST

Original text of this message

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