zoukankan      html  css  js  c++  java
  • mysql in 子查询 效率慢,对比

     desc SELECT id,detail,groupId from hs_knowledge_point where groupId in (
        SELECT groupId from hs_knowledge_point where groupId>0 GROUP BY groupId HAVING COUNT(groupId) > 1 
        UNION all
        SELECT groupId from hs_knowledge_point_commit where groupId>0 GROUP BY groupId HAVING COUNT(groupId) > 1 
    )
    UNION ALL
    SELECT id,detail,groupId from hs_knowledge_point_commit where groupId in (
        SELECT groupId from hs_knowledge_point where groupId>0 GROUP BY groupId HAVING COUNT(groupId) > 1 
        UNION all
        SELECT groupId from hs_knowledge_point_commit where groupId>0 GROUP BY groupId HAVING COUNT(groupId) > 1 
    )
    View Code
    SELECT id,detail,groupId from hs_knowledge_point where groupId in (
        select groupId from (
            SELECT groupId from hs_knowledge_point where groupId>0 GROUP BY groupId HAVING COUNT(groupId) > 1 
            UNION all
            SELECT groupId from hs_knowledge_point_commit where groupId>0 GROUP BY groupId HAVING COUNT(groupId) > 1 
        ) tmp
    )
    UNION ALL
    SELECT id,detail,groupId from hs_knowledge_point_commit where groupId in (
        select groupId from (
            SELECT groupId from hs_knowledge_point where groupId>0 GROUP BY groupId HAVING COUNT(groupId) > 1 
            UNION all
            SELECT groupId from hs_knowledge_point_commit where groupId>0 GROUP BY groupId HAVING COUNT(groupId) > 1 
        ) tmp
    )
    View Code

  • 相关阅读:
    C# 3.0新特性之扩展方法
    ObservableCollection 类
    Path的Data
    INotifyPropertyChanged 接口
    Django的最佳系统结构
    Django 结构及处理流程分析
    django最佳实践:项目布局
    近期的几个ASP.NET开发经验总结和收集(一)
    Javascript对象Clone
    ASP.NET20 自定义配置节学习笔记(一)
  • 原文地址:https://www.cnblogs.com/shixm/p/7300937.html
Copyright © 2011-2022 走看看