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

  • 相关阅读:
    【一起来烧脑】读懂HTTP知识体系
    Day16:小前端
    Day15:大前端
    Day14:CSS垂直居中
    Day13:H5+JS+C3
    web学习
    javascript 闭包
    微信小程序微信登录
    微信小程序开源
    mpvue搭建小程序框架
  • 原文地址:https://www.cnblogs.com/shixm/p/7300937.html
Copyright © 2011-2022 走看看