鴻飛

导航

 
 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

 

 

 

 

posted on 2017-08-07 19:33  鴻飛  阅读(366)  评论(0编辑  收藏  举报