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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-03-01 : 08:54:11
|
Dan writes "Using SQL 2000 sp1, win 2k sp2I am currently storing information on downloads - with two related tables, one for the download info, and the other for the area in which the download occured(classID).Anyways, I have a result set that looks like this:DownloadID classid partid -------------------- ----------- ----------- 1 34 705292 34 705293 34 711204 44 711885 44 709116 34 71191 How would I return a result that that counted classid's, looked something like:classid numdl----------- --------34 444 2 Thanks much." |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-03-01 : 09:04:00
|
| SELECT classid, Count(*) numdl FROM myTable GROUP BY classid ORDER BY classid |
 |
|
|
|
|
|