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');    
  
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;  
注意,当需要序列值时,不能放在子查询中
INSERT INTO T_A  
  (id,  
  goodsA_id,  
  goodsB_id,  
  goodsC_id,  
  num,  
  money,  
  dateA_id,  
  dateB_id,  
  create_date)  
  (SELECT test1_SEQUENCE.NEXTVAL,  
  goodsA_id,  
  goodsB_id,  
  goodsC_id,  
  num,  
  money,  
  dateA_id,  
  dateB_id,  
  SYSDATE  
  FROM (SELECT goodsA_id,  
  goodsB_id,  
  goodsC_id,  
  num,  
  33 money  
  FROM goods_info),  
  (SELECT id dateA_id,  
  period dateB_id  
  FROM date_x  
  WHERE flagA = 'Y'))  
insert into u_role(role_id,role_no,role_name,role_desc,is_enable,role_seq,amount_level) select SQ_U_ROLE.nextval as role_id,
actor_no,actor_name,actor_desc,is_enable,actor_seq,amount_level from u_actor