看了看相关的帖子 还是一头雾水啊 希望高手解答~小弟不胜感激~就是 t1表: id,name,time,num,aaat2表: tid,tName,num,aaa更新时t1表name变为0,同时t2表num变为2,关联是aaa相等并且t1表time等于一个时间望高手解答

解决方案 »

  1.   

    update t1 set num=0 from t1 as a inner join t2 as b on a.aaa=b.aaa and a.time='xxx'
    update t2 set num=2 from t2 as a inner join t1 as b on a.aaa=b.aaa and b.time='xxx'
      

  2.   

    如果不能用两个Update那就的在T1上见触发器去更新T2
      

  3.   


    update a set a.num=0 from t1 a,t2 b where a.aaa=b.aaa and a.time='';
    update b set b.num=2 from t1 a,t2 b where a.aaa=b.aaa and a.time='';
      

  4.   

    update a set a.num=0 from t1 a,t2 b where a.aaa=b.aaa and a.time='';
    update b set b.num=2 from t1 a,t2 b where a.aaa=b.aaa and a.time='';