Fatal error: SafeMySQL: 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 s.id ORDER BY CASE WHEN g.price IS NULL THEN 1 else 0 END, CASE WHEN ' at line 6. Full query: [ SELECT s.title, s.link, s.images, s.condition, MIN(g.price) price, g.price_old, COUNT(g.id) count_g, g.status, g.akcii, g.stock FROM sku s LEFT JOIN good g ON g.sku=s.id WHERE s.id IN() GROUP BY s.id ORDER BY CASE WHEN g.price IS NULL THEN 1 else 0 END, CASE WHEN g.stock=0 THEN 1 else 0 END, CASE WHEN g.price=0 THEN 1 else 0 END, s.`sort`]. Error initiated in /var/www/www-root/data/www/pehota.by/t/pageTags.php on line 60, thrown in /var/www/www-root/data/www/pehota.by/i/classes/SafeMySQL.class.php on line 601