SELECT  a.name as "Account Name", count(ac_c.contact_id) AS "Mismatched Account FS Count" FROM  contacts_cstm cs, accounts_contacts ac_c, accounts_cstm ac, contacts c, accounts a WHERE  a.id = ac.id_c AND a.id = ac_c.account_id AND cs.id_c = ac_c.contact_id AND cs.id_c = c.id AND ac_c.primary_account=1 AND a.deleted=0 AND  ac_c.deleted=0 AND c.deleted = 0 AND cs.feature_switches_account_c != ac.feature_switches_account_c GROUP BY
a.id HAVING count(ac_c.contact_id) > 0 ORDER BY a.name;