I have a table containg product detail records. Each product has multiple records of the exact same data except for two fields: prod_cost and cost_key. When a product's cost changes, the cost_key is incremented and a new detail record is placed in this table for that product.
How do you select only the records with the MAX cost_key for each product?
How do you select only the records with the MAX cost_key for each product?