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