有没有代替in的sql语句? 要看情况,有时可以用exists代替,有时只能用 or代替 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 in用在这种枚举类型的情况下效率不会很低的,可以用or或union代替in(1,2,3,4)的写法,但是效率也不会提高的,只有在用在子查询的情况下才会影响效率:select * from t1 where id in (select id from t2)这种情况可以用exists代替:select * from t1 where exists(select 1 from t2 where t2.id = t1.id) 如果是IN子查询的话可以用EXIST代替,这钟列举的好象代替不了吧. 自表关联统计查询 JOB执行时间设置 oracle 中调用拆分字符串的方法的问题 修改参数后的问题 为何在只装了oracle client 的机了上,没法运行 rman; 急求Oracle客户端安装包(越小越好) 怎么登陆DBA studio ??? 能否直接将Excel中的所有内容保存到一个Oracle二进制字段(Long Raw型)中? 关于Oracle触发器的问题? 两表多关键字进行联合的条件查找该怎么做? 关于锁表的问题?(for update nowait) 急~求助各位大侠!oracle put_line的问题!
这种情况可以用exists代替:
select * from t1 where exists(select 1 from t2 where t2.id = t1.id)