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
Post a Comment