frosty
frosty

Reputation: 2649

Selecting rows from database only when those rows exceeds a certain number

I need to select specific rows from the database, but only if those rows exceeds a certain number. For instance, I need to get a specific name from the database, but only if that name has more than 25 rows. How would I write that query in SQL?

SELECT name FROM names WHERE count(name) >= 25 

Upvotes: 1

Views: 31

Answers (1)

Teja
Teja

Reputation: 13524

SELECT name 
  FROM names
GROUP BY name
 HAVING count(name) >= 25;

Upvotes: 4

Related Questions