不用For循环

解决方案 »

  1.   

    试试
    insert table2 (select ID from table1 where ID not in select ID from table2)
    其中ID为公有字段
      

  2.   

    nmqhzh(昨夜风)是正确的!哈哈
      

  3.   

    错了!
    更正如下:insert table2 (select * from table1 where ID not in select ID from table2)两表结构完全一致(字段名、排列顺序),才可用上句!否则如下式:insert table2(A,B,C,D) (select A,B,C,D from table1 where ID not in select ID from table2)
    其中A,B,C,D为表字段名
      

  4.   

    用ado联接。一样这么写吗?
      

  5.   

    不知道满足你的要求哟
     table1 ,table2 都有 name,id ,两栏位
    首先判定 table1 ,table2 纪录条数是否相同,相同的话再求两个表的交集,记录条数
    不变的话就相同select name||id  from table1
    intersect
    select name||id  from table2
    纪录条数相同,则两个表完全相同,没有用for的哟
      

  6.   

    我所述在SQLSERVER上通过,ACCESS应该也可以!
      

  7.   

    nmqhzh(昨夜风) 老大,小弟我还是搞不太懂。能给我个完整点的吗?