sql server - How do you return all data in SQL based on specific number of rows -


i have column "country" in "address" table.

i want return data countries have 10 rows.

for example, if france has 10 rows (and other countries) want see them. if have italy 9 records don't want see it.

thank you!

create 1 group per country, , demand group has 10 rows:

select  country    address group         country having  count(*) = 10 

to return rows countries, can use subquery:

select  *    address   country in         (         select  country            address         group                 country         having  count(*) = 10         ) 

Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -