Categories

SELECT p.* FROM `products` p INNER JOIN ( SELECT MAX(id) AS max_id FROM `products` GROUP BY `title` ) AS latest_products ON p.id = latest_products.max_id ORDER BY p.id DESC LIMIT 30;