表结构一样,tb200901_hyda为空.insert into tb200901_hyda
       select * from  tb200909_hyda
       where f_jb='1' 
违反了 PRIMARY KEY 约束 'phyda200901'。不能在对象 'tb200901_hyda' 中插入重复键。
语句已终止。

解决方案 »

  1.   

    tb200901 确定没有数据么?
    重新把表tb200901_hyda给删除,然后使用
    select * into tb200901_hyda from tb200909_hyda where f_jb='1'
      

  2.   

    tb200909_hyda 中对应 tb200901_hyda 中的主键有重复.
      

  3.   

    我刚开始学c语言,有没有qq群收留小弟,646397629.希望能得到各位高手的指点
      

  4.   

    或者不要删除,直接插入也可以
    insert into tb200901_hyda(字段1,字段2....)
    (select 字段1,字段2.... from  tb200909_hyda 
    where f_jb='1' 
    and 主键字段 not in (select 主键字段 from tb200901_hyda)
    group by 字段1,字段2.... 
    )