Hello,
I have a SQL table and i am performing some Count on the column values and then displaying it using ASP.NET's gridview to the frontend.
I am using below SQL query
select currentstepname,
sum(case when bundledtype in ('1','3','5') then 1 else 0 end) Count1,
sum(case when bundledtype in ('2','4','5') then 1 else 0 end) Count2,
sum(case when currentstepname in ('Decider','Checker') then 1 else 0 end) Count3,
count(*) as GrandTotal,
from table1
where currentstepname in ('EV Bucket','IV Bucket')
group by currentstepname
Now what i want is to get the total sum of each of Alias columns aswell and show it as the final row of the gridview.
What i am currently seeing at the GridView is as follows.
|CurrentStepName | Count1 | Count2 | Count3 | GrandTotal
Decider -------------- 8---------- 0 ------- 0------------ 8
Checker--------------- 4 --------- 0 ------- 0 ----------- 4
EVBucket-------------- 0--------- 20------- 14----------- 34
IVBucket-------------- 0---------- 10------ 5 ----------- 15
TotalCount---------12-------30-----------19------------61
In the above gridview i want the Bold Line (TotalCount) to be added. It counts the value of all the column values.
I hope i have made myself clear.
Looking forward to your help
Thanks a ton,
What I have tried:
Searcher google but could not find a similar problem