I have a table full of magazines, and need to extract the latest unique issue of each magazine.
Ive tried
SELECT DISTINCT magazine F
SELECT p.* FROM product p INNER JOIN ( SELECT magazine, MAX(onSale) AS latest FROM product GROUP BY magazine ) AS groupedp ON groupedp.magazine = p.magazine AND groupedp.latest = p.onSale ;