0

Hello All!

I have a MySQL database with 4 items, id (numerical), group_name, employees, and surveys.

I need to in my select calulate the percentage of 'employees' who my the number in 'surveys' have taken the survey.

This is the statement I have now:

SELECT group_name, employees, surveys, COUNT( surveys ) AS percentage, 
            ((COUNT( * ) / ( SELECT COUNT( * ) FROM db_test)) * 100 ) AS percentage
        FROM db_test
        ORDER BY surveys
2
Contributors
1
Reply
19
Views
4 Years
Discussion Span
Last Post by TonyG_cyprus
0

So lets get this right and clarify, are you saying for instance if the total No of employees is 100,
and the total No of surveys is 50, you want an answer of 50% ??

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.