原来以为not exists 会比not in 效率高,但在实际运用过程中,发现两表数据差不多的情况下,用另一种方式效率会更好. 原设计语句: select * from (select * from ex_22222 where exattribute1 = "13") K1 where not exists ( select * from ( select ex_22222.entityid from ex_22222,ut_users where exattribute1 = "13" and ex_22222.entityid = ut_users."UID" ) K2 where K1.ENTITYID = K2.ENTITYID ) 新改进语句: select K1.ENTITYID,K2.ENTITYID from (select * from ex_22222 where exattribute1 = "13") K1, ( select * from ( select ex_22222.entityid from ex_22222,ut_users where exattribute1 = "13" and ex_22222.entityid = ut_users."UID" ) ) K2 where K1.ENTITYID = K2.ENTITYID(+) and K2.ENTITYID is nullOracle数据库查询的五个小窍门MySQL序列解决方案相关资讯 oracle
- [INS-32052] Oracle基目录和Oracle (07/22/2014 07:41:41)
- Oracle 4个大对象(lobs)数据类型 (02/03/2013 12:33:05)
- Oracle按时间段分组统计 (07/26/2012 10:36:48)
| - [Oracle] dbms_metadata.get_ddl的 (07/12/2013 07:37:30)
- Liferay Portal 配置使用Oracle和 (07/31/2012 20:07:18)
- Concurrent Request:Inactive (07/20/2012 07:44:05)
|
本文评论 查看全部评论 (0)