If you select distinct pricename ... you will get Red & Blue ... but you need more than that, right? OK. Problem is you also have PriceCost in there... how do you know which ONE of those you want? There's nothing to make them unique.

Ideally you should have had two tables... one with PriceName and an ID ... the other with ID, PriceNameID, PriceCost, and possibly some kind of date. that will then let you get back to a specific date and identify the specific price in effect.

LEss than ideal, you have it all in one table... PriceName, PriceCost and a date...

In both cases you would group by price name and get the max date... then join that back to the table on both fields and that would give you all of the PriceCosts for each of the PriceNames.


-tg