update  表2  set add_qq='OK' from 表1,表2 where (select qq_num from 表1 where qq_num in( select qq_num from 表2))第 1 行: ')' 附近有语法错误。请教一下,这一句,语法哪里错了,请赐教,谢谢select qq_num from 表1 where qq_num in( select qq_num from 表2)  这一句是通过的,但不知道为什么一连起来就出错了,诚心求教,谢谢

解决方案 »

  1.   

    update 表2 
    set add_qq='OK' 
    from 表1,表2 
    where 表1.qq_num=表2.qq_num
      

  2.   

    update 表2 set add_qq='OK' from 表1,表2 where 表1.qq_num=表2.qq_num
      

  3.   

    你的语句自己复杂化了
    update tb2 
    set add_qq='OK' 
    where qq_num in (select qq_num  from tb1)
    或者
    update tb2
    set add_qq='OK' 
    from tb2
    inner join tb1 on tb2.qq_num=tb1.qq_num
      

  4.   

    update 表2 set add_qq='OK' from 表2 where 表2.qq_num in (select qq_num from 表1)update 表2 set add_qq='OK' from 表2 where exists (select 1 from 表1 where qq_num = 表2.qq_num)update 表2 set add_qq='OK' from 表2 , 表1 where 表2.qq_num = 表1.qq_num