SELECT V.* FROM t_products AS P LEFT JOIN t_products_manufac AS V ON V.id = P.vyrobce WHERE P.kategorie IN (,4,8,1,5,2,6,3,7) AND P.publikovano = 1 GROUP BY V.id 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 '4,8,1,5,2,6,3,7) AND P.publiko' at line 6