I know there are tons of Topics like this. But I can not find a solution for this. Maybe there is an other way than Group.
I have this query
Select id1, id2, share from table1 Result:
| id1 | id2 | share | +-------+------+------------+ | 3864 | 3083 | 0.157223 | | 3864 | 3095 | 0.007548 | | 57695 | 3095 | 1 | | 57749 | 2864 | 0.99516 | I want the highest share grouped by id1 without losing the id2
So it should look like this:
| id1 | id2 | share | +-------+------+------------+ | 3864 | 3083 | 0.157223 | | 57695 | 3095 | 1 | | 57749 | 2864 | 0.99516 | I could do this: group only by id1 and do a join on the old table by id1 and the share to get the id2.
But there must be a better way?