用表A的数据去更新表B的数据的问题,这其实是常用到的呀。
code=SQL]
update yddz a set djbh=(select trim(plll_bz) from plll b where trim(a.yddh)=trim(b.plll_dh))
where exists(select * from plll c where trim(a.yddh)=trim(c.plll_dh) and nvl(trim(a.djbh),'')<>nvl(trim(c.plll_bz)),'')[
[/code]
------解决方案--------------------------------------------------------
使用了trim函数之后,即使那几个字段有索引也用不到。如果确实需要,那么就创建针对trim的函数索引。