啥也不说了,贴上sql:
create or replace view my_project_view as
select *
from 表A t where status='XXX' and pro_status='x' and ( flag <>'x' or flag is null ) and
( LEAD_ID = fruit_view_param.get_paramthree() or t.auto_id in
(select PROJECT_ID from 表B where LEAD_ID=fruit_view_param.get_paramthree()
or AUTO_ID in ( select PROJECTIMPL_ID from 表C where LEAD_ID=fruit_view_param.get_paramthree())
) );
问题:对于where xxx in 子句效率极其低下问题,求大神指教 。 我这个语句该如何去写。
Oracle in子句 效率低下
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- 叶之秋 2017-07-03 08:58关注
create or replace view my_project_view as
select *
from 表A t where status='XXX' and pro_status='x' and ( flag <>'x' or flag is null ) and
( LEAD_ID = fruit_view_param.get_paramthree() or exists
(select PROJECT_ID from 表B where LEAD_ID=fruit_view_param.get_paramthree() and t.auto_id = PROJECT_ID
or exists ( select PROJECTIMPL_ID from 表C where LEAD_ID=fruit_view_param.get_paramthree() and AUTO_ID = PROJECTIMPL_ID
) );本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 maple软件,用solve求反函数出现rootof,怎么办?
- ¥50 汇编语言除法溢出问题
- ¥65 C++实现删除N个数据列表共有的元素
- ¥15 Visual Studio问题
- ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
- ¥20 求一个html代码,有偿
- ¥100 关于使用MATLAB中copularnd函数的问题
- ¥20 在虚拟机的pycharm上
- ¥15 jupyterthemes 设置完毕后没有效果
- ¥15 matlab图像高斯低通滤波