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 |
|
srk
Starting Member
4 Posts |
Posted - 2008-12-23 : 00:43:33
|
| urgency..pls help solve it....i have a table with fields company,county...there are lot of counties and many companies registered to these companies.i wanna take the count of companies corresponding to each county.Should look likeCounty[b/] [b]Number------------- --------------Carlow 1727Cavan 2169Clare 3882Cork 18852 etc..............srk |
|
|
Jai Krishna
Constraint Violating Yak Guru
333 Posts |
Posted - 2008-12-23 : 00:49:25
|
| SELECT County AS 'County[b/]',Count(DISTINCT Company) AS '[b]Number' FROM yourtable GROUP By County ORDER BY CountyJai Krishna |
 |
|
|
srk
Starting Member
4 Posts |
Posted - 2008-12-23 : 00:51:47
|
sorry stupid question. thnx.i was very much screwed up with this work that i forgot the basic things....thanks matesrk |
 |
|
|
Jai Krishna
Constraint Violating Yak Guru
333 Posts |
Posted - 2008-12-23 : 00:52:33
|
| WelcomeJai Krishna |
 |
|
|
|
|
|