insert into a(a,b,c,d,e,f,g) select '' as a,'' as b,'' as c,'' as d,e,f,g from b
'',替换成需要的
a,b,c,d不是相同的值,用游标循环插入?看看楼下

解决方案 »

  1.   

    说清楚a,b,c,d以什么规律插入数据
      

  2.   

    a,b,c,d插入的新的数据从哪来的?
      

  3.   

    那你的a表的a,b,c要插入新的什么值呢?
      

  4.   

    比如表A(a,b,c,d,e,f,g);表B(e,f,g)   
                    实现把表B中的记录插入到表A中,但是表A中的字段a,b,c,d也要插入新的数据~~~~~~~~~~~~~
    --------------------------------------
    插入什么新的数据呢?
      

  5.   

    比如表A(a,b,c,d,e,f,g);表B(e,f,g)   
                    实现把表B中的记录插入到表A中,但是表A中的字段a,b,c,d也要插入新的数据
    insert into A select a=newdata,b=newdata,c=newdata,d=newdata,e,f,g from B
      

  6.   

    表A(a,b,c,d,e,f,g)字段;表B(e,f,g)字段   
        实现把表B中的记录插入到表A中的同时,表A中的字段a,b,c,d也要插入新的数据~~~~~~~~~~~~~
      

  7.   


    insert into A select a=a,b=b,c=c,d=d,e,f,g from B
      

  8.   


      
    insert into a(e,f,g) select e,f,g from b
    where not exists(select 1 from a where a.e=b.e and a.f=b.f and a.g=b.g)insert into b(e,f,g) select e,f,g from a
    where not exists(select 1 from b where a.e=b.e and a.f=b.f and a.g=b.g)