select * from t1 where b in (select b from (select b,count(b) cn from t1 group by b) where cn>10);
不需要这么复杂吧 16:12:39 SQL> select col1 from tb;COL1 ---------- A A A B B B B C c已选择9行。已用时间: 00: 00: 00.63 16:15:11 SQL> select col1 from tb group by col1 having count(*)>3;COL1 ---------- B已用时间: 00: 00: 00.16 16:15:17 SQL> select col1 from tb group by col1 having count(*)>2;COL1 ---------- A B已用时间: 00: 00: 00.16 16:15:21 SQL> 楼主不是这个意思吗?
bzszp的方法很好 楼主应该就是这个意思吧
select name as 名字,count(name) as 出现次数 from tbname group by name having count(name)>=10
16:12:39 SQL> select col1 from tb;COL1
----------
A
A
A
B
B
B
B
C
c已选择9行。已用时间: 00: 00: 00.63
16:15:11 SQL> select col1 from tb group by col1 having count(*)>3;COL1
----------
B已用时间: 00: 00: 00.16
16:15:17 SQL> select col1 from tb group by col1 having count(*)>2;COL1
----------
A
B已用时间: 00: 00: 00.16
16:15:21 SQL>
楼主不是这个意思吗?
楼主应该就是这个意思吧
from tbname
group by name
having count(name)>=10