var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: help needed with sql query. percentage of the females.
I have following table
How can I get percentage of females in this table?
Thanks a lot!
SELECT Sum(CASE WHEN 'Yes' = female THEN 1e0 END) / Count(*)
This should be faster on big number of records:
select FemalesPercentage = 100.0 * sum(case when female = 'Yes' then NumberOf else 0.0 end) / sum(NumberOf)
from (select female,
NumberOf = count(1)
group by female) as x