I have the following database:
And I want to count all the entries with the same
Fixed and tested version of Dans answer:
SELECT teamname, count(*) AS TeamSize, max(numberOfMembers) AS maxMembers FROM yourTable GROUP BY teamname HAVING TeamSize < maxMembers
But you should normalize your table. No need to repeat the general teamdata and restrictions for every user.