title: How to have condition inside count SQL?
body: <p>I already tried this code: </p>
  
  <pre><code>    SELECT Count(Gender) As MaleCount, Count(Gender) As FemaleCount
      FROM [Session4].[dbo].[Survey]
      Where Gender = 'M' or Gender = 'F' 
  </code></pre>
  
  <p>I can't get the accurate data when counting with two different conditions in one query.</p>
  
  <p>Pictures below: </p>
  
  <p>This is the result.</p>
  
  <p><a href="https://i.stack.imgur.com/guBMw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/guBMw.png" alt="enter image description here"></a></p>
  
  <p>This is the original data</p>
  
  <pre><code>SELECT  TOP (1000) [Departure]
      ,[Arrival]
      ,[Age]
      ,[Gender]
      ,[CabinType]
      ,[Q1]
      ,[Q2]
      ,[Q3]
      ,[Q4]
  FROM [Session4].[DBO].[Survey]
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/FxVzK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FxVzK.png" alt="enter image description here"></a></p>