I have SQL table with 3 columns - product, product version, and results(number). I want to create a query that return the max result to each uniq version.
Simple data :
product | version | results |
---|---|---|
X | 1 | 50 |
X | 1 | 51 |
X | 1 | 53 |
X | 2 | 60 |
X | 2 | 62 |
X | 3 | 70 |
X | 4 | 80 |
X | 4 | 80 |
X | 4 | 80 |
Y | 1 | 50 |
Y | 2 | 60 |
Y | 3 | 70 |
Y | 4 | 80 |
In this table, the return value for product X version 1 will be 53, product X version 2 - 62, product X version 3 - 70 and so on.
how can i get this query ?