update tbl1 t1 set b=
(select b from tbl1 t2 where t1.b is not null and b<>'' and t1.a=t2.a where rownum<2)
where b is null or b=''

解决方案 »

  1.   

    select b from tbl1 t2 where t1.b is not null and b<>'' and t1.a=t2.a where rownum<2
    怎么又两个where
      

  2.   

    update tbname t set b=(select max(b) from tbname tt where tt.a=t.a)
    where exists(select 1 from tbname tt where tt.a=t.a);
      

  3.   

    update tblname t1 set b=(select t2.b from tblname t2 where t2.b is not null and t2.a=t1.a and rownum<2) where t1.b is null