update tableA a
set (a.name,a.d_date) = (select b.name,b.d_date from tableB
where b.ID=a.ID and b.d_date>a.d_date);

解决方案 »

  1.   

    写掉了点东西:
    update tableA a
    set (a.name,a.d_date) = (select b.name,b.d_date from tableB b
    where b.ID=a.ID and b.d_date>a.d_date)
      

  2.   

    update tableA
    set (tableA.name , tableA.d_date) = 
      (select tableB.name, tableB.d_date from tableB where tableA.id = tableB.id )
    where exists 
      (select 1 from tableB where tableA.id = tableB.id and tableB.d_date > tableA.d_date)
      

  3.   

    to outwindows(水花):
    不加条件更新的话,b.d_date <= a.d_date 的纪录会被更新成null值