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 |
|
sqlilliterate
Starting Member
40 Posts |
Posted - 2009-08-24 : 14:18:52
|
Hi all,Help me with a query using CTE to arrive my desired output...Table 1 id num---- ----a 1b 2c 3Table 2 id num---- ----a 5b 8c 9Expected Output num mx ---- ---- 5 8 --> num + max num value from table1 (5+3)8 16 --> num + previous max value (8+8)9 25 --> num + previous max value (9+16) I would not like to use a while loop or a temp table for this...Your thoughts on this would be a great help to me...Thnx in adv... |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
|
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2009-08-25 : 12:47:53
|
thx alot blindman!!! Hope can help...but advise to wait pros with confirmation... |
 |
|
|
|
|
|