SELECT `p`.*, round(avg(rating)) as avg_rating, count(rating) as rating_count FROM `product` `p` LEFT JOIN `user_rating` as `ur` ON `p`.`product_id` = `ur`.`product_id` WHERE `category` LIKE '%132%' ESCAPE '!' GROUP BY `p`.`product_id` LIMIT 20