En DISTINCT
skal gøre det, du leder efter:
SELECT DISTINCT items.ItemName, items.ItemId FROM items
JOIN sales ON items.ItemId = sales.ItemId
WHERE sales.StoreID = ? ORDER BY sales.SaleWeek DESC;
Det ville kun returnere distinkte items.ItemName, items.ItemId
tupler.