In sql i have a column called answer and it can either be 1 or 2, i need to generate an SQL query which counts the amount of one and twos for each month, i have the following query but it does not work:
SELECT MONTH(`date`), YEAR(`date`),COUNT(`answer`=1) as yes,
COUNT(`answer`=2) as nope,` COUNT(*) as total
FROM results
GROUP BY YEAR(`date`), MONTH(`date`)
Hope someone can help thanks in advanced!