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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Needs... Single SQL Statement

Author  Topic 

kamalkishore_in
Yak Posting Veteran

76 Posts

Posted - 2001-06-01 : 02:18:30
Hi Gurus..

Is this possible in Single SQL Statement...
I have a table Structure like :

No...Field1...Field2....Field3
0.......0.........0......1000
1....100.........0.........0
2......0.......200.........0
3.....50.......100........0

And I want the result like :

No...Field1...Field2....Field3
0.......0.........0......1000
1....100.........0........900
2......0.......200.......1100
3.....50.......100.......1150

Actullay .. what is happening in above is.....

Field3 = previous(Field3) (Minus) field1 (plus) field2

I hope you got it....
Queries are welcome....
Thankx in Advance....

   

- Advertisement -