日期:2014-05-17 浏览次数:20700 次
SELECT 部门
FROM A
WHERE 业绩 > 7
GROUP BY 部门
HAVING COUNT(1) = (SELECT COUNT(DISTINCT 月份) FROM A)
select t1.depart,count(*) from (select * from t where t.yeji>7) t1
group by t1.depart
having count(*)=(select count(distinct mth) from t);
SELECT * FROM A
select T.部门 FROM
(SELECT A.部门,COUNT(A.月份) 次数 from A WHERE A.业绩>7 GROUP BY A.部门) T
WHERE T.次数=( select count( distinct a.月份) from a)