有没有代替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代替,这钟列举的好象代替不了吧. oracle读取xml的信息问题 imp导入时报错 oracle:NO Listner错误 一个关于delete的问题 ORA-01467: sort key too long的的问题?在线等........... 如何将 Oracle 数据导出到 Excel 中? oracle导出 a problem about partitioning 游标是否能存放多个结果集? 如何使用oracle pl/sql 遍历指定directory下的所有文件 关于锁表的问题?(for update nowait) 急~求助各位大侠!oracle put_line的问题!
这种情况可以用exists代替:
select * from t1 where exists(select 1 from t2 where t2.id = t1.id)