Click here to Skip to main content
15,912,072 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
sno	Particular	Dr
1	a	        2
2	a1	        3
3	a2	        4
4	a total	        9 (2+3+4) 
5	b	        3
6	b1	        1
7	b2	        1
8	b3	        1
9	b4	        1
10	b total	       16 (9+3+1+1+1+1)
Posted
Updated 17-Aug-12 11:09am
v2
Comments
I.explore.code 17-Aug-12 9:03am    
Your question doesn't seem to be making a lot of sense. Can you explain a little bit more and perhaps show the code that you have written to try to achieve it?
ssd_coolguy 17-Aug-12 9:11am    
hey..why don't to go for running sum query?...
[no name] 17-Aug-12 9:30am    
You would ceratinly benefit from reading this http://www.codeproject.com/Articles/64628/Code-Project-Quick-Answers-FAQ

1 solution

In SQL Server you can do a select like this

select a, b, a+b as c from myTable.

This will return three columns, with c being an invented column based on the existing values ( a and b added ). You can also do things like MAX ( to get the highest value ), MIN ( to get the lowest ) and SUM ( to get a total ).

I think that answers you, if it doesn't, then improve your question so it actually is a clear question.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900