多谢四大天王,补充一下,我说的都是在存储过程中比如下面三个情况,数据量比较大的话,2是比1 快的吧,3跟它们比呢? 1.in update a .. where a.type_code in (select type_code from b)2.exists update a... where exists (select 1 from b where b.type_code = a.type_code)3.cursor for v_type in cur_type_code update a.... where a.type_code = v_type.type_code
1.in
update a ..
where a.type_code in (select type_code from b)2.exists
update a...
where exists (select 1 from b where b.type_code = a.type_code)3.cursor
for v_type in cur_type_code
update a....
where a.type_code = v_type.type_code
http://www.21eok.com/school/2003-3-3/200333185821.htm
IN和EXISTS:
...实际上第二种格式要远比第一种格式的效率高。在Oracle中可以几乎将所有的IN操作符子查询改写为使用EXISTS的子查询.............
http://www.5xsoft.com/data/200107/2020045901.htm
速度怎么样?
? > ? > ?
如果业务复杂,用Exists语句出点什么问题会整死人的