lulu50
asked on
Get the total of the count
Hi,
I have this query
that generate this output
the problem that I am having is the percentage in my query I hard coded "741"
that supose to be the total of my cound and I don't know how to get it.
In my query I have the percentage:
cast(((count(*) * 100.0) / 741) as DECIMAL(10,2)) as Percentage
cast(((count(*) * 100.0) / ?????????) as DECIMAL(10,2)) as Percentage
741 is the sum of my count how can I do this
sum(count(*)) ?????
not sure please help
I have this query
select count(*) as Total, ST.ApplicationType,
cast(((count(*) * 100.0) / 741) as DECIMAL(10,2)) as Percentage from AppRepository AP
left join SourceType ST on AP.applicationType = ST.SourceID
where AP.Retired = 0
group by AP.ApplicationType, ST.ApplicationType
that generate this output
Total ApplicationType Percentage
5 Access 0.67
21 Client 2.83
1 Crystal Reports 0.13
303 Distributed 40.89
25 Distributed/Mainframe 3.37
1 Function 0.13
242 Mainframe 32.66
1 Other 0.13
24 Web - External/Distributed 3.24
76 Web - Internal/Distributed 10.26
41 Web - Internal/External - Distributed 5.53
1 Web - Internal/Mainframe 0.13
the problem that I am having is the percentage in my query I hard coded "741"
that supose to be the total of my cound and I don't know how to get it.
In my query I have the percentage:
cast(((count(*) * 100.0) / 741) as DECIMAL(10,2)) as Percentage
cast(((count(*) * 100.0) / ?????????) as DECIMAL(10,2)) as Percentage
741 is the sum of my count how can I do this
sum(count(*)) ?????
not sure please help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you
ASKER
Thank you for your help
it works!!!!!!!!!!!!!!!!!!!!!