INSERT SELECT statement in Oracle 11G

后端 未结 5 414
醉梦人生
醉梦人生 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:13

    Your query should be:

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

    I.e. without the VALUES part.

提交回复
热议问题