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 |
|
danielhai
Yak Posting Veteran
50 Posts |
Posted - 2002-02-26 : 14:55:55
|
| 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:<pre>DownloadID classid partid -------------------- ----------- ----------- 1 34 705292 34 705293 34 711204 44 711885 44 709116 34 71191</pre>How would I return a result that that counted classid's, looked something like:<pre>classid numdl----------- --------34 444 2</pre>Thanks much. |
|
|
Tigger
Yak Posting Veteran
85 Posts |
Posted - 2002-02-26 : 15:19:02
|
| SELECT CLASSID, COUNT(*) AS NUMDLFROM TEMPGROUP BY CLASSIDReplace TEMP with the name of your result set. |
 |
|
|
|
|
|