SELECT `d`.`id`, `d`.`idCity`, `d`.`name`, `d`.`alias`, `d`.`image`, `d`.`rating`, `d`.`price`, `d`.`specialPrice`, `d`.`degree`, `d`.`category`, `d`.`description`, `d`.`experienceYear`, COUNT(`r`.`id`) AS `numRev`, "doctor" AS `type` FROM `simpt_doctor` AS `d` LEFT JOIN `simpt_clinic_doctor` AS `cd` ON `cd`.`d_id` = `d`.`id` LEFT JOIN `simpt_clinic_office` AS `co` ON `co`.`id` = `cd`.`c_id` LEFT JOIN `simpt_db_review` AS `r` ON `r`.`idDoctor` = `d`.`id` AND `r`.`published` = "1" AND `r`.`ratingDoctor` > 0 WHERE `d`.`idDocDoc` IN () GROUP BY `d`.`id` ORDER BY `internalRating` DESC LIMIT 180, 20
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') GROUP BY `d`.`id` ORDER BY `internalRating` DESC LIMIT 180, 20' at line 1