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 2008 Forums
 Transact-SQL (2008)
 Addition Of previous two rows into new row

Author  Topic 

Shadab Shah
Starting Member

23 Posts

Posted - 2012-07-19 : 05:49:13
I am a newbie and was trying around and come up with this problem:
Suppose i have a table A having column as:
col1
100
350
-120
100

i want the output as
col1
100
450
330
430

The output is actually addition of 100+350=450,450+(-120)=330,330+100=430.

And i have only this column in my table.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-07-19 : 06:07:23
please do not cross post

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=176920


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Shadab Shah
Starting Member

23 Posts

Posted - 2012-07-19 : 06:09:49
I was not getting appropiate answer over there so thought of posting it here :-)
Go to Top of Page
   

- Advertisement -