title: Calculating % from a char value
body: <p>I'm trying to calculate what proportion of my data are male and what proportion are female.</p>
  
  <p>I have the following code:</p>
  
  <pre><code>select 
    SUM(CASE WHEN Gender = 'M' THEN 1 ELSE 0 END) / COUNT(Gender) as perc_male,
    SUM(CASE WHEN Gender = 'F' THEN 1 ELSE 0 END) / COUNT (Gender) as perc_female
  From [my_table]
  </code></pre>
  
  <p>However when running this I get 0%. Can anyone see what I might be doing wrong here?</p>
  
  <p>Thanks</p>