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: update multi column

Re: update multi column

From: TurkBear <johng_at_nospam.mm.com>
Date: Wed, 02 Dec 1998 16:23:32 GMT
Message-ID: <366568d5.6086692@news2.mm.com>


c.undieseastwood_at_gu.edu.au (Chris East wood) wrote:

>HiYa
>
>I have 2 tables, A is data, and B is fixed data. I wanted to update more than
>one colum of table A with a corresponding row's information from B.
>
>there is only 1 key.
>
>I can't quite figure how to do it damnit its late and I'm fed up! :-)
>
>IE something like
>
>update A
>set IDN = (select idn from B where A.key = B.key)
>where A.key = B.key
>
>

Try
Update A set idn = (select idn from B where A key = B key), idx = (select idx from B where Akey = B key), etc.......

Separate the column names and the expressions used to update them by commas and then you need only one SET command...
To reply please remove the 'nospam' part of the address Received on Wed Dec 02 1998 - 10:23:32 CST

Original text of this message

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