Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: update table
If I understand you, it would be
insert into table1
select * from table2
You may or may not want to truncate table1 first.
Variation
delete from table1 where pk in (select pk from table2)
insert into table1 select * from table2
or
truncate table table1
insert......
or
drop table1
create table1 as select * from table2
etc.
gloriaz_ca_at_yahoo.com (Gloria Zhao) wrote in message news:<fcb331b6.0109240838.52590692_at_posting.google.com>...
> Hi there,
>
> Is it possible to update a table as the following in Oracle:
>
> update table1 set * = (select * from table2 where table1.key=
> table2.key);
>
> If it's inpossible doing it in sqlplus, is there any other similiar
> solutions in PL/SQL? I mean some special functions which could let us
> update all columns in table1 with the info in table1 where the the
> records in table1 and table2 have the same key.
>
> Thanks a lot in advance.
>
> Gloria
Received on Mon Sep 24 2001 - 16:01:58 CDT