let say i have one table, which have data like:
name status
bob single
bob single
jane null
tina null
shane married
i want if status "single or data null" it means single. so if data empty script can read it as single and can count together. so i can show result like:
Single Married
3 1
i have tried with this and it doesnt work:
SELECT SUM(IF(status='single',1,0)) AS Single,
SUM(IF(status='married',1,0)) AS Married
FROM table