in查询优化

来源:互联网 发布:网络歌手性感的拖鞋 编辑:程序博客网 时间:2024/05/22 19:48
select ai.act_name from act_info ai whereai.act_id in (select DISTINCT(object_id) from rel_base_recomm where work_type = 1)in优化: 在in的内层包装一张表 :select ai.act_name from act_info ai whereai.act_id in (select object_id from( select DISTINCT(object_id) from rel_base_recomm where work_type = 1) as tmp )这样可以优化in的查询速度
原创粉丝点击