$SQL = "SELECT pc.dist_id, pc.route, pc.types,
COUNT( pc.types = '$type' ) total,
COUNT( pc.types = '$type' AND pc.options = '1') callbacks
FROM per_call pc
WHERE pc.types = '$type'
GROUP BY pc.dist_id, pc.route, pc.types
ORDER BY pc.dist_id, pc.route";
In short, I guess I’m asking how COUNT works with multiple columns inside the ().
Countwill work as well :Note: it works because
COUNTreturns count of the number of non-NULL values, andCASEhas defaultELSE NULL…