insert into tab1 select a1,a2,a3,'a','c' from tab2

解决方案 »

  1.   

    SQL> desc test1
    名称                          是否为空?类型
    ------------------------------- -------- ----
     ID                                       NUMBERSQL> desc test
    SP2-0561: 对象不存在
    SQL> create table test2 as select * from test1;表已创建。SQL> insert into test1 values(5);已创建 1 行。SQL> edi
    已写入文件 afiedt.buf  1* insert into test1 values(6)
    SQL> /已创建 1 行。SQL> commit;提交完成。SQL> insert into test2 select * from test1;已创建6行。SQL> commit;提交完成。SQL> select * from test2;        ID
    ----------
             1
             2
             3
             4
             1
             2
             3
             4
             5
             6已选择10行。SQL> drop table test1;表已丢弃。
      

  2.   

    afiedt.buf是做什么用的????
      

  3.   

    afiedt.buf记录的是目前运行的语句,可以对这条语句在记事本中打开进行修改,修改后保存再用/就可以执行修改后的语句了!
      

  4.   

    insert into tab1 
      (select B.a1,B.a2,B.a3,'a','c' from tab2 B WHERE NOTEXIST 
             (SELECT DISTINCT A.a1,A.a2,A.a3 FROM tab1)
      )
    这样就不会因KEY重 报错啦
      

  5.   

    insert into tab1 
      (select B.a1,B.a2,B.a3,'a','c' from tab2 B WHERE NOT EXISTS
             (SELECT DISTINCT A.a1,A.a2,A.a3 FROM tab1)
      )
    写快了!(:
      

  6.   

    to:
        waiting_another_job(等待机会转行) 
    为什么要案用兵existshwq26(就这样吧) 
    的方法有什么不妥吗?请教