SELECT GROUP_CONCAT(DISTINCT network_topics.topic_id SEPARATOR '|') as topic_id, network_topics.topic_name, count(*) as 'count' FROM network_alert INNER JOIN network_topics ON network_alert.topic_id = network_topics.topic_id INNER JOIN clubs ON network_alert.clb_id = clubs.clb_id WHERE network_alert.topic_id IS NOT NULL AND active='1' AND private='0' GROUP BY network_topics.topic_name ORDER BY network_topics.topic_name asc LIMIT 100 :Column 'active' in where clause is ambiguous