Link to home
Start Free TrialLog in
Avatar of pda4me
pda4me

asked on

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?
ASKER CERTIFIED SOLUTION
Avatar of derekkromm
derekkromm
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i think in the above query good to add this small change :)

select distinct(officename) from agent group by officename having count(*) > 20
shouldn't need the distinct with the group by
Avatar of pda4me
pda4me

ASKER

Worked AWESOME!