I have a table with one column containing many duplicate values, and a second column with values. I want to filter my table so column 1 is all of the unique values corresponding with the max of column 2.
So I might have,
Col1, Col2
Yellow, 4
Yellow, 6
Red, 1
Red, 4
Blue, 2
I want my resulting table to be
Yellow, 6
Red, 4
Blue, 2
I've tried using a self-join, aggregating by max on Col2 and then keeping only the max values, but it's really slow. Are there any better approaches?
So I might have,
Col1, Col2
Yellow, 4
Yellow, 6
Red, 1
Red, 4
Blue, 2
I want my resulting table to be
Yellow, 6
Red, 4
Blue, 2
I've tried using a self-join, aggregating by max on Col2 and then keeping only the max values, but it's really slow. Are there any better approaches?