Wilk There was an error running the query: SELECT * FROM (SELECT b.Rubrik, b.Sokvag_S, b.Sokvag_M, b.Sokvag_L, brp.bilder_id, pk.ID FROM bilder b JOIN bilder_rel_produktkategorier brp ON brp.bilder_id = b.ID JOIN produktkategorier pk ON pk.ID = brp.produktkategorier_id UNION DISTINCT SELECT b.Rubrik, b.Sokvag_S, b.Sokvag_M, b.Sokvag_L, brm.bilder_id, pk.ID FROM bilder b JOIN bilder_rel_modeller brm ON brm.bilder_id = b.ID JOIN modeller m ON m.ID = brm.modeller_id JOIN produktkategorier pk ON pk.ID = m.ParentID) AS items WHERE items.ID LIKE GROUP BY items.bilder_id ORDER BY RAND() LIMIT 0,10; :IIII: SELECT b.broschyrGlobal as brochure, b.tekniskspecGlobal as technical_data, b.ID as ParentID, p.Namn as name, p.Slogan as slogan, p.Beskrivning as description, p.broschyr as family_brochure, p.teknspec as family_technical_data, p.ID, p.bild1Frilagd as product_image, m.Pris, mk.* FROM modeller m, huvudgrupper h, brands b, produktkategorier p LEFT JOIN modellkampanjer mk ON p.ID = mk.produktkategori WHERE m.ParentID = p.ID AND (b.ParentID = h.ID) AND (p.ParentID = b.ID) AND h.Fordonstyp = 'Husvagnar' AND b.Namn = 'Wilk' AND p.Namn = 'Sento' AND m.active = 1 GROUP BY p.Namn ORDER By h.Fordonstyp, b.Namn; Error: 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 items.bilder_id ORDER BY RAND() LIMIT 0,10' at line 19