Re: update problem
Date: Thu, 25 Jul 2002 14:49:52 -0400
Message-ID: <ahpdg7$k5v$1_at_news.bentley.com>
Marc:
Do this:
update TableA set ColC = (select col2 from TableB where col1 =
TableA.colB)
I assume you wanted to set ColC to the values in col2. If I'm wrong, change
the selected column.
There is also a way to do it by updating the subselect (in 9i only, I
believe). Take a look at updateable views in the doc.
HTH,
"M" <morc66_at_hotmail.com> wrote in message
news:vWV%8.23147$uV1.1216367_at_zwoll1.home.nl...
Tom Best
> Hi all,
>
> I have this, probably very easy to solve, problem to solve:
>
> I am trying to update a talble using entries in another table.
>
> TableA
> colA colB colC
> 1 A 1
> 2 B x
> 3 X 13
>
> TableB
> col1 col2
> Z 123
> H 223
> B 323
>
> now I want to update tableA ColC where tableAcolB = tableBcol1, in fact
> updating all rows from tableA which have entries in table B.
>
> It seems to be unpossible using a subselect in a update... or am I wrong?
> (yep,... newbie)
>
> Marc
>
>
Received on Thu Jul 25 2002 - 20:49:52 CEST