August 27, 2013 at 5:22 am
HI,
I have table like the given below
gradelosalhisal
17001200
212011400
314012000
420013000
530019999
so, i need the Total of that cols like given below
gradelosalhisal
17001200
212011400
314012000
420013000
530019999
Total 8304 17599
plz help me
August 27, 2013 at 5:29 am
select convert(varchar(5), grade), losal, hisal from {table}
union all
select 'Total', sum(losal), sum(hisal) from {table}
I've converted the [grade] column to a varchar datatype in the first SELECT to make it possible to include the word 'Total' in the second SELECT.
August 27, 2013 at 8:27 am
Even if the solution given will show the correct result, you should consider to do this calculations in the front end.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply