Check out example codes for "condition in count sql". It will help you in understanding the concepts better.

Code Example 1

select count(case Position when 'Manager' then 1 else null end)
from ...


select sum(case Position when 'Manager' then 1 else 0 end)
from ...

Learn ReactJs, React Native from akashmittal.com