INSERT SELECT statement in Oracle 11G

后端 未结 5 409
醉梦人生
醉梦人生 2020-11-30 13:40

I\'m trying to run a very simple sql statement in Oracle 11g.

 insert into table1 (col1, col2) values (select t1.col1, t2.col2 from oldtable1 t1, oldtable2 t         


        
5条回答
  •  春和景丽
    2020-11-30 14:02

    You don't need the 'values' clause when using a 'select' as your source.

    insert into table1 (col1, col2) 
    select t1.col1, t2.col2 from oldtable1 t1, oldtable2 t2;
    

提交回复
热议问题