15,741,818 members
See more:
hi
this is hem raj thakur I have a sum problem in a sql query. I want to do Sum of a multipal column in a sql server2005.I have a table like

ID Hindi Pol_Science History Math Total
-- ----- -------- ------ ----- ----
1 67.00 67.00 89.00 89.00 ?
2 89.00 89.00 88.00 67.00 ?
3 55.00 65.00 69.00 90.00 ?
4 56.00 78.00 98.00 67.00 ?

I wanna "sum" of multipal "column" in "total" in per single row.
like this

ID -- Hindi -- Pol_Science -- History --- Math --- Total
-- -- ----- -------- ------ ----- ----
1 -- 67.00 ---67.00 --- 89.00--- 89.00 --- 312.00
2 -- 89.00 --- 9.00 --- 88.00 --- 67.00 --- 333.00
3 -- 55.00 --- 65.00 --- 69.00 --- 90.00 --- 279.00
4 -- 56.00 --- 78.00 --- 98.00 --- 67.00 --- 299.00

Posted
Updated 29-Aug-13 20:34pm
v2

## Solution 1

SQL
`select a,b,c,d,(a+b+c+d) as total from table_name`

replace a,b,c,d with your column name..

v2
Hem Raj Thakur 30-Aug-13 2:39am
this answer is useful for me thank you very much.
[no name] 30-Aug-13 2:46am
u r welcome..