Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

MySQL query pull data greater than 20

i have a table called agent.  this table has a field called officeName.  

How do I select all distinct officeName where there are more than 20 instances of agents for that office?
0
pda4me
Asked:
pda4me
  • 2
1 Solution
 
derekkrommCommented:
select officename from agent group by officename having count(*) > 20
0
 
alagurjanTechnology LeadCommented:
i think in the above query good to add this small change :)

select distinct(officename) from agent group by officename having count(*) > 20
0
 
derekkrommCommented:
shouldn't need the distinct with the group by
0
 
pda4meAuthor Commented:
Worked AWESOME!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now