SELECT p.*, pi.* , FLOOR(prodratingtotal/prodnumratings) AS prodavgrating, 0 AS prodgroupdiscount FROM [|PREFIX|]products p LEFT JOIN [|PREFIX|]product_images pi ON (p.productid=pi.imageprodid AND pi.imageisthumb=1) WHERE p.prodvisible=1 AND p.productid IN (821994,821997,816066,816069,140192) GROUP BY p.productid ORDER BY prodsortorder ASC