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

Home -> Community -> Usenet -> c.d.o.server -> Re: Update question

Re: Update question

From: Joachim Carlsson <joachim.carlsson_at_neurope.ikea.com>
Date: 1998/06/10
Message-ID: <357E7CF1.E2BC36D7@neurope.ikea.com>#1/1

This is how you do it.

update table1

     set column1=(select feature from table2, table3
                             where table2.column2=table3.column2
                             and     table1.column1 = table3.column2)
    where exists (select '1' from table2, table3
                        where table1.column1 = table2.column2
                        and     table1.column1 = table3.column2);

You must use the double where clause if you you don't want to update every row of table1.

Regards
/Joachim

Linda K. Johnson wrote:

> Is there a way to update one table with selected fields from another
> table? The only way we see (and it doesn't work) requires trying to
> return more than one row to the set statement.
>
> i.e.
> update table1
> set column1=(select feature from table2, table3
> where table2.column2=table3.column2)
>
> It returns too many rows to the update. Thanks for any help.
>
> Please send any responses to pacosta_at_lctx.com or the newsgroup.
>
> Thanks again,
>
> Paul Acosta
Received on Wed Jun 10 1998 - 00:00:00 CDT

Original text of this message

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