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 |
|
sumitarora
Starting Member
2 Posts |
Posted - 2005-09-04 : 13:59:15
|
| I want a query for the follwing ---->The salaries in a table aresalary======10002000300040005000I want the output of the query assalary======1000300060001000015000 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2005-09-04 : 15:40:10
|
| select salary = (select sum(t2.salary) from tbl where t2.salary <= t1.salary)from salary t1order by t1.salaryIt's better to give a descriptive title to questions if you want people to take an interest.==========================================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. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-09-05 : 00:43:54
|
| Small correction on nr's queryselect salary = (select sum(t2.salary) from tbl t2 where t2.salary <= t1.salary)from salary t1order by t1.salaryMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|