Re: update problem

From: M <morc66_at_hotmail.com>
Date: Fri, 26 Jul 2002 21:29:24 +0200
Message-ID: <sph09.27893$uV1.1703195_at_zwoll1.home.nl>


thanks Tom

"Tom Best" <oracle_person_at_yahoo.com> schreef in bericht news: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,
> Tom Best
>
> "M" <morc66_at_hotmail.com> wrote in message
> news:vWV%8.23147$uV1.1216367_at_zwoll1.home.nl...
> > 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 Fri Jul 26 2002 - 21:29:24 CEST

Original text of this message