ORACLE语法中的INSERT INTO...SELECT...语句
把一表里的数据取出直接插进另外一表
set feedback off;
set pagesize 0;
create table foo (a number, b varchar(10), c varchar(10));
insert into foo values ( 15, 'abc','def' );
insert into foo values (998, 'max','min' );
insert into foo values ( 7, 'bla','bla' );
insert into foo values (632, 'now','then');
www.2cto.com
insert into foo
(a,b,c)
(select AA,
BB,
CC
from
(select max(a) +1 AA from foo),
(select 'new' BB,
'old' CC from dual));
select * from foo where a = (select max(a) from foo);
drop table foo;
作者 taoxingtianxia