Imagine a table T with two fields f1 and f2
Lets put some dummy values:
(1,2) , (1,3) , (1,4), (2,2), (4,1), (4,2)
I would like to retrieve the max value of f2 for each f1 namely I would like my query to return :
(1,4), (2,2), (4,2)
How can I achieve this ?
You have to use
group byand aggregate functionmax()Links to more informations: