customer表
有个name 还有个country
查某个国家超过10个客户的客户的姓名 比如
A 美国
b 中国
c 中国
d 中国
e 中国
f 中国
g 中国
h 中国
i 中国
j 中国
k 中国
l 中国
m 中国
o 中国
p 中国 除了第一条 别的都要查出来
有个name 还有个country
查某个国家超过10个客户的客户的姓名 比如
A 美国
b 中国
c 中国
d 中国
e 中国
f 中国
g 中国
h 中国
i 中国
j 中国
k 中国
l 中国
m 中国
o 中国
p 中国 除了第一条 别的都要查出来
COUNTRY IN(SELECT COUNTRY FROM TB GROUP BY COUNTRY HAVING COUNT(*)>=10)
*
from
tb
where
country in(select country from tb group by country having count(1)>10)
from tb t
where (select count(1) from tb where country=t.country)>=10
name,country
from
TB
where
country in(select country from tb group by country having count(1)>10)
select country from customer group by country having count(1) >= 10
(select country from customer group by country having count(1) >= 10)
from tb t
where (select count(1) from tb where country=t.country)>=10