SELECT COUNT(*) AS c FROM ( SELECT COUNT(*) FROM (SELECT `colleges`.`id` FROM `college`.`colleges` WHERE `delReason`="" AND `colleges`.`subj_id`=77) a LEFT JOIN `college`.`specs` as cs ON cs.col_id = a.`id` LEFT JOIN `college`.`okso` ON `okso`.`id` = `okso_id` WHERE cs.base= GROUP BY a.`id` ) z
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'GROUP BY a.`id` ) z' at line 11