update tableA a set a.a=(select b.a from tableB b where b.b=..)
where a.c=b.c and a.d =b.d想些上面意思那样的语句,但是where后面的条件无法使用b.*,有人说要嵌套着写,但是我想不出来,麻烦大家了。
where后面的条件不能写到括号里去,不然意思就错了。

解决方案 »

  1.   

    update tableA a set a.a=(select b.a from tableB b where b.b=..)
    where exists(select 1 from tableB b where a.c=b.c and a.d =b.d)
      

  2.   

    update tableA a set a.a=(select b.a from tableB b where b.b=.. , a.c=b.c and a.d =b.d)
      

  3.   

    update tableA a set a.a=(select b.a from tableB b where b.d=a.d and b.c=a.c)
    ;
      

  4.   

    我说过“where后面的条件不能写到括号里去,不然意思就错了。”