日期:2014-05-17  浏览次数:20687 次

问个oracle,update小问题
update collection c set c.biblio_id=(select b.id from biblio b where b.school_id=933 and b.bookrecno=c. bookrecno and rownum=1) where exists
(select 1 from biblio b where b.school_id=933 and b.bookrecno=c. bookrecno) and c.school_id=933 and c.id <=2495991 and biblio_id = 1

这里更新条件中的 bookrecno用 number(10) 和 varchar(255)
是不是用number(10)的会更新的更快)
------最佳解决方案--------------------
条件判断的时候,最好不要使用隐式转换
所以使用number类型会更好
------其他解决方案--------------------
主要是要建索引,number(10) 和 varchar(255)的区别很小。