select A1 from tabel where A1 not in (select A2 from tabel)

解决方案 »

  1.   

    用SQL语句:select * from table where a1=a2
      

  2.   

    select A1 from table where A1 not in (select A2 from table)
      

  3.   

    insert into Table (A3)
    select A1 from Table where A2 
    where not in (select A1 from Table)别忘了给分
      

  4.   

    insert into Table (A3)
    select A1 from Table
     where A2  not in (select A1 from Table)别忘了给分
      

  5.   

    不好意思。我可能没说明白。A1和A2字段中相同的数据并不是一一对应的。也就是相同的数据并不是有相同的id号。有没有办法解决?谢谢!
      

  6.   

    因为a2里的号码也是从a1中选出的,所以我的想法是能不能把a2里的数据和a1做一个对比。没有的保存a3中,因为a2的数据是后加入的并不没有和a1中相同的数据付给相同的id号,不知有没有办法解决
      

  7.   

    update a 
    set a.A3 = b.A1 
    from tabel a,(select ID,A1 from table where A1 not in (select A2 from table)) b
    where a.ID = b.ID
      

  8.   

    dulei115---对你这么晚还在关注这个问题非常感谢,可还是不对。
      

  9.   

    Select a1 From table
    Where a1 Not In
    (Select a2 From table)