本帖最后由 newkid 于 2015-1-14 22:39 编辑
update aaa t
set t.name =
(select max(t3.name1)
from aaat1,
bbb t2,
ccct3
where t.no=t1.no
andt1.no = t2.no
and t2.no = t3.no)
where t.trans_date = to_char(20141024)
and t.name is null;
这样岂不是让aaa表的name=联查选出的最大值,但实际结果是更新的所有名字都不同
t和t1明明是一张表,t.no=t1.no意义何在?
这个语句有没有优化的余地