Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: little sql help
I found a better answer:
update b
set (b.fist_name,b.last_name) =
( select a.fist_name,a.last_name from a where a.id = b.id ) where b.id in ( 1,2,3 ... );
Hth,
Mitsunori Ishikawa
Mitsunori Ishikawa wrote:
>
> How about the following statment?
>
> update b
> set b.last_name = ( select a.last_name from a where a.id = b.id ),
> b.fist_name = (select a.fist_name from a where a.id = b.id )
> where b.id in ( 1,2,3, ....);
>
> Regards,
>
> Mitsunori Ishikawa
>
> Ed Zappulla wrote:
> >
> > Hi, I need a little help with an update statement. I have 2 tables linked
> > by id and want to update table A with some data in table A. I want to set
> > table B's last and first name from table A's. Ideas?
> >
> > A:
> > id
> > last_name
> > fist_name
> >
> > B:
> > id
> > last_name
> > fist_name
Received on Wed Dec 27 2000 - 22:46:30 CST