Fatal error: Uncaught exception 'Doctrine_Connection_Mysql_Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 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 p.id ORDER BY rank_populair DESC LIMIT 0, 16' at line 10. Failing Query: " SELECT `p`.`id` AS `id`, `p`.`number` AS `number`, `p`.`sale` AS `sale`, `p`.`action` AS `action`, `p`.`discount` AS `discount`, `p`.`price_new` AS `price_new`, MIN(`q`.`price`) AS `price_low`, IF(p.sale = 1, price_new , MIN(`q`.`price`)) as price, i.filename_thumb, p.txt_head, p.soldout, p.hsd, u.description, p.date_from as date, sc.url as subCategoryUrl, mc.url as mainCategoryUrl, p.date_introduction FROM product p LEFT JOIN quantity_price q ON p.id = q.product_id LEFT JOIN image i ON p.id = i.product_id LEFT JOIN unit u ON p.unit_id = u.id LEFT JOIN list_bra in /var/www/Core/Doctrine/Connection.php on line 1082