81 Colleges and Course Providers in Dublin

WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'HAVING facility_count > 41)' at line 18]
SELECT sl_posts.ID,
(
SELECT count(sl_p.ID)
FROM sl_posts sl_p
WHERE sl_p.post_author = sl_posts.post_author
AND sl_p.post_type = 'colleges'
AND (sl_p.post_status = 'publish' OR sl_p.post_status = 'private')
) as facility_count
FROM sl_posts
INNER JOIN sl_postmeta sl_pm ON (sl_posts.ID = sl_pm.post_id)
INNER JOIN sl_term_relationships tr2 ON (sl_posts.ID = tr2.object_id) INNER JOIN sl_term_taxonomy tt2 ON (tr2.term_taxonomy_id = tt2.term_taxonomy_id)
WHERE ( 1=1
AND (sl_pm.meta_key = 'sl_findacourse_college_active_field' AND sl_pm.meta_value != '')
AND ((tt2.taxonomy = 'course_area' AND tt2.term_id != '264')
AND (tt2.taxonomy = 'course_area' AND tt2.parent != '264'))
AND sl_posts.post_type = 'colleges'
AND (sl_posts.post_status = 'publish' OR sl_posts.post_status = 'private')
HAVING facility_count > 41)