日期:2014-05-18 浏览次数:20577 次
SELECT * FROM [tabguzhang] G WHERE G.ID IN (SELECT G.ID FROM [tabzhengzhao] WHERE zhengzhaoID=4)
------解决方案--------------------
SELECT A.* FROM 故障表 AS A INNER JOIN ( SELECT B.GUZHANGID,COUNT(1) AS NUM FROM 征兆表 AS B WHERE B.ZHENGZHAO IN('A','B','C','D') GROUP BY B.GUZHANGID ) AS C ON A.ID=C.GUZHANGID WHERE C.NUM >= 4