SELECT V.* FROM t_products AS P LEFT JOIN t_products_manufac AS V ON V.id = P.vyrobce WHERE P.kategorie IN (,671,538,539,544,545,546,615,547,540,541,542,543,548,620,623,34,467,468,469,465,85,552,472,617,684,683,426,573,647,660,661,662,663,501,421,568,666,567,92,640,470,389,80,513,688,553,625,659,626,627,76,96,519,507,679,696,97,520,697,514,570,571,572,581,515,550,551,563,564,565,566,670,516,633,693,694,695,634,635,636,75,209,648,176,177,502,582,607,586,8,120,433,508,524,432,649,664,665,534,16,265,531,118,409,499,498,500,518,590,608,641,6,506,7,521,15,554,556,346,348,682,557,226,38,406,415,452,650,19,624,198,609,47,450,451,20,143,312,313,141,352,387,407,591,651,606,64,65,71,171,340,12,503,504,505,199,652,161,21,644,29,30,150,430,431,530,148,673,672,41,156,595,596,423,371,370,613,674,675,676,677,48,314,315,639,154,476,475,152,153,605,601,680,681,592,637,439,445,533,474,526,4,17,46,136,137,618,653,23,401,690,692,654,612,162,163,598,599,642,569,416,420,211,212,217,223,214,216,597,678,691,53,205,427,428,585,611,169,656,667,668,669,2,127,525,306,689,434,536,657,3,292,18,558,638,559,125,411,560,602,616,603,604,646,486,487,488,489,490,496,13,462,658,112,289,290,291,535,580,455,685,686,687,14,280,630,283,527,408,574,577,575,578,645,491,492,493,494,600,72,189,610,208,629,655,583,584,56,587,588,631,32,549,236,632,349,628,62,485,10,70,466) AND P.publikovano = 1 GROUP BY V.id 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 '671,538,539,544,545,546,615,547,540,541,542,543,548,620,623,34,467,468,469,465,8' at line 6