I have a table of products and each record has the price it was sold at, which can vary
x
Product Price
a 2
a 3
a 4
a 1
b 10
b 15
b 20
I want a query which will give be the max price at which product a was sold and max price at which product b was sold and nothing more
I have thousands of products so case will not help
Advertisement
Answer
Use MAX
and Group By
SELECT Product, MAX(Price)
FROM YourTable
GROUP BY Product