TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Anurag Srivastava
NA
39
0
Want to add rows values to show in a new row
Nov 3 2011 2:15 AM
Hi
I have a problem, I want to add the rows values.
I have rows in table like
Months Values
Jan-2010 5
Feb-2010 10
Mar-2010 7
Apr-2010 2
Logic for the result:
Jan-2010 - 5
Feb-2010 -15 (Jan-2010 + Feb-2010)
Mar-2010 -22 (Jan-2010 + Feb-2010 + Mar-2010)
Apr-2010 -2 (Jan-2010 + Feb-2010 + Mar-2010 + Apr-2010)
I want results set like this
Months Values
Jan-2010 5
Feb-2010 15
Mar-2010 22
Apr-2010 24
Pls help on urgent basis
Thanks in Advance
Regards
Anurag
Reply
Answers (
5
)
Temporary Tables in SQLSERVER
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.