Этот запрос вызывается в php. Вызывает ошибку - 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 `coments`.`id_coment` ORDER BY `date` DESC' at line 1. ПОмогите написать правильний запрос. Код (Text): SELECT *, (SELECT COUNT(`act`) FROM `likes` WHERE `act` = 1) AS 'likes', (SELECT COUNT(`act`) FROM `likes` WHERE `act` = 0) AS 'dislikes' FROM `coments` JOIN `likes` ON coments.`id_coment` = likes.`coment` JOIN `users` ON `user` = `id_user` HAVING `article` = '$article' GROUP BY `coments`.`id_coment` ORDER BY `date` DESC --- Добавлено --- Проблема решена Код (Text): SELECT *, (SELECT COUNT(`act`) FROM `likes` WHERE `act` = 1) AS 'likes', (SELECT COUNT(`act`) FROM `likes` WHERE `act` = 0) AS 'dislikes' FROM `coments` JOIN `users` ON `user` = `id_user` JOIN `likes` ON coments.`id_coment` = likes.`coment` WHERE `article` = '$article' GROUP BY `id_coment` ORDER BY `date` DESC