Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
BendJoe
Posting Yak Master
128 Posts |
Posted - 2008-05-07 : 15:03:12
|
| I need to list all the states which has more than 10 cities .Table is CityID, City , State.What is the query to do this.Thanks |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-07 : 15:05:49
|
| Can we see what you tried till now? |
 |
|
|
BendJoe
Posting Yak Master
128 Posts |
Posted - 2008-05-07 : 16:05:35
|
| Select State, Count(City) from Table Group by StateThis gives two columns state and count of city in the state but I dont know how to filter it with a where clause. |
 |
|
|
BendJoe
Posting Yak Master
128 Posts |
Posted - 2008-05-07 : 16:35:17
|
| Select State From Table Group By State Having Count(City)>10Will this work? |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-05-07 : 17:07:45
|
| yep |
 |
|
|
|
|
|