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 |
|
babuuser9
Starting Member
3 Posts |
Posted - 2011-03-23 : 11:18:15
|
| a b c 23 12 12 234 453 54 32 323 23 23 34 45 333 45443 534 i want output like(23 + 12)/5423(a) and 12(b) are in 1st row, but 54(c) is in 2nd rowthat iteration should repeati am new to sql and i know it should be simplecan you guys help me out |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2011-03-23 : 11:28:10
|
SQL doesn't really work that way... use excel.Corey snSQL on previous signature "...Oh and by the way Seventhnight, your signature is so wrong! On so many levels, morally, gramatically and there is a typo!" |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-03-23 : 11:31:33
|
| To do this, you need some way of ordering the rows. Data in a table is an unordered collection even though it may look like it is when you do a select query.The ordering scheme can be either another column which has a row number, for example, or it could be based on some type of logic. But you need a way to order the rows.Once you can do that, then doing what you described is relatively easy. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-03-24 : 07:29:45
|
| Search for running total and get some ideaMadhivananFailing to plan is Planning to fail |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-03-24 : 07:31:50
|
quote: Originally posted by Seventhnight SQL doesn't really work that way... use excel.Corey snSQL on previous signature "...Oh and by the way Seventhnight, your signature is so wrong! On so many levels, morally, gramatically and there is a typo!" 
Corey, where have you been all these days? MadhivananFailing to plan is Planning to fail |
 |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2011-03-24 : 08:50:32
|
I haven't been doing much SQL work... mostly .NetGot a new job recently, so I've been adjusting to 2005/8 :PI see alot of the same people are still cranking away at it... Corey snSQL on previous signature "...Oh and by the way Seventhnight, your signature is so wrong! On so many levels, morally, gramatically and there is a typo!" |
 |
|
|
|
|
|
|
|