update tab_a
set
col1=(select ...)
col2=(select ...)
col3=(select ...)
where ...

解决方案 »

  1.   

    不知道理解的对不对:
    update table1 a set column=... where 条件1 and exists (select '1' from table2 b where a表的三个字段=b表的三个字段)
      

  2.   

    类似于
    update tab_a
    set ...
    where 
    col1=(select ...from a where ..)
    col2=(select ...from a where..)
    col3=(select ...from a where..)from来自同一表的三个字段,同一条件
      

  3.   

    应该是这样吧,我不知道理解你的问题对不对
    update tab_a
    set  ...
    where col1 = (select col1 from tab_b) and
          col2 = (select col2 from tab_b) and
          col3 = (select col3 from tab_b);
      

  4.   

    update tab_a
    set
    col1=(select ...)
    col2=(select ...)
    col3=(select ...)
    where ...
      

  5.   

    col1=(select ...from a where ..)
    col2=(select ...from a where..)
    col3=(select ...from a where..)
    一定要唯一,不然要改成以下:
    col1 in (select ...from a where ..)
    col2 in (select ...from a where..)
    col3 in (select ...from a where..)语句变得复杂了,为何不用游标,真不明??
      

  6.   

    如果是要更新三个字段
    update tab_a set 
      (filed1,field2,field3)=(select fieled1,field2,field3 select tab_b where ...) where ...;
      

  7.   

    有,比较简单,你试试用吧update tab_a
    set ...
    where col1||col2||col3=(select col1||col2||col3 from tab_b where tab_a.id=tab_b.id)
      

  8.   

    to: : beckhambobo(beckham) 
    必须要转换成字符型的吧,不过已经很简单了。谢谢!
      

  9.   

    beckhambobo老兄,你的算法会不会产生笛卡尔积?
    col1=null col2='200' col3=null 和
    col1='200' col2=null col3=null 等效吧
      

  10.   

    update tab_a
    set ...
    where nvl(col1,1)||nvl(col2,2)||nvl(col3,3)=(select nvl(col1,1)||nvl(col2,2)||nvl(col3,3) from tab_b where tab_a.id=tab_b.id)