select a.* from 表 a,(select class from 表 group by class having count(distinct id)>=3)b where a.class=b.class
select class from t group by class having count(*)>2 或 select distinct class from t a where (select count(*) from t where class=a.class )>2
select id,count(class) from table group by class having count(class)>2
select class,count(id) where count(id)>3 group by class
这样吧! select class from table group by class having count(class)>=3
同意楼上的 或 select class from table group by class having count(*)>=3
select a.* from 表 a,(select class from 表 group by class having count(id)>=3)b where a.class=b.class不带distinct,即不是 select a.* from 表 a,(select class from 表 group by class having count( distinct id)>=3)b where a.class=b.class
select class from tableName group by class having count(*)>=3
from 表 a,(select class from 表 group by class having count(distinct id)>=3)b
where a.class=b.class
或
select distinct class
from t a
where (select count(*) from t where class=a.class )>2
from table
group by class
having count(class)>2
select class from table
group by class
having count(class)>=3
或
select class from table
group by class
having count(*)>=3
from 表 a,(select class from 表 group by class having count(id)>=3)b
where a.class=b.class不带distinct,即不是
select a.*
from 表 a,(select class from 表 group by class having count( distinct id)>=3)b
where a.class=b.class