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 |
|
Vivaldi
Constraint Violating Yak Guru
298 Posts |
Posted - 2001-05-02 : 10:40:58
|
| Well,Back again with more confusion.I have a "lookup" table of countiesID | CountynameI want to loop through all the counties in the tableinside a stored proc and in that loopget an average from another temp table that is based on that average, but i have 4 specific averages i need to retrieve in order for each county.so in pseudofor each county get avg for male felonies for county get avg for male misdeamenors for county get avg for female felonies for county .....nextso that table has county1 | avg1 | avg2 | avg3 | avg4county2 | avg1 | avg2 | avg3 | avg4county3 | avg1 | avg2 | avg3 | avg4county4 | avg1 | avg2 | avg3 | avg4and i can return that for formatting to my asp page.I know how to do this using asp but if there were 100 + counties thats alot of db calls to be making.Any leads? i have a feeling a cursor is in order, if you could just point me in a direction that will lead to a euphoric state, I would be most pleased.Software Composer |
|
|
|
|
|