I have table which looks like this
sales units
100 1
200 3
100 2
200 4
100 5
100 1000
I want to select maximum sales with maximum units
for above example output should be
100 1000
200 4
i tried to use max function it gives wrong answer
e.g 200 1000
Since you have changed your question, the answer is: