標籤:com 技術 sed closed where gif commit ima select
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 ALLSELECT 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 ALLSELECT 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
mysql in 子查詢 效率慢,對比