解决方案 »

  1.   

    update table1
    set col2=(select col4 from table2 where col3=table1.col1)
    where exists(select 1 from table2 where col3=table1.col1)或者,如果table2上的col3字段有唯一约束,可以
    update(select t1.col2,t2.col4 from table1 t1,table2 t2 where t1.col1=t2.col3)
    set col2=col4
      

  2.   

    用您的方法1,报了“单行子查询返回多个行”,我的table1中的col1不是唯一的-、-
      

  3.   

    ... 不是table1中col1不唯一,而是table2中的col3不唯一
    这种情况下,你要怎么取呢?
    如果随便取一条,在子查询里加个rownum<2就好了