update a set a.a=0 from a,b where a.id=b.aid and b.c1=1 and b.c2=1

解决方案 »

  1.   

    update a set a= (select 0 from b where a.id=b.aid and b.c1=1 and b.c2=1)
    where exists (select 0 from b where a.id=b.aid and b.c1=1 and b.c2=1)
      

  2.   

    singlepine(小山) 怎么跑到oracle版来了啊
      

  3.   

    表b 上还有c3 c4 c5 上的值为可选(有的为空,有的有值)
      

  4.   

    to:jiezhi(风满袖) ( ) 信誉:137 
    俺也偶尔到处跑跑,早就知道你在这里很牛,特地过来瞧瞧。在.net版三星、oracle版四星,总榜第25,的确很厉害,俺佩服的很,还请多指教哦^_^
      

  5.   

    update a set a.a = 0 where exists (select 1 from b where a.id=b.aid and b.c1=1 and b.c2=1)
      

  6.   

    update a set a=0 where a.id in (select aid from b where b.c1=1 and b.c2=1)
      

  7.   

    update a set a=0 where a.id in (select aid from b where b.c1=1 and b.c2=1) 這個可以實現結果
      

  8.   

    楼上的方法对啊
    update a set a=0 where a.id in (select aid from b where b.c1=1 and b.c2=1)
      

  9.   

    update 表a set a=0
    where exists (select 1 from 表b where 表b.c1=1 and 表b.c2=1 and 表b.aid = 表a.id)