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 |
|
avmreddy17
Posting Yak Master
180 Posts |
Posted - 2006-01-29 : 16:15:50
|
| Can some one help me writing a set based Solution .....Symbol-----PriceMSFT--------23.00MSFT--------24.00MSFT--------26.00MSFT--------28.00MSFT--------29.00MSFT--------23.00MSFT--------33.00MSFT--------44.00MSFT--------43.00MSFT--------23.00MSFT--------23.00MSFT--------23.00MSFT--------23.00MSFT--------23.00MSFT--------24.00Just want to average Price every 10 rows together , but not using the CURSOR.Like Rows 1 to 10 -----AveragePriceRows 11 to 20 --- AveragePrice.......etcThxVenu |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-01-29 : 16:49:13
|
| Rows in a table have no inherent order, so what would be the way to know the first 10 rows, next 10 rows, and so on?CODO ERGO SUM |
 |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-01-29 : 17:30:07
|
| given an integer seq column to number the rowsselect seq / 10, avg(Price)from tblgroup by seq / 10==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|