Question:
I have a simple table where I’m calculating a “level value” dynamically viaSELECT
with repeated Ids in this table, what I’m trying to do is to Group the rows Ids by the greatest level value.Fiddle: https://www.db-fiddle.com/f/2Pyfi2PMV8eaQbDt2uWQjc/2
I already tried using
CASE
in Group and Order but does not work well.I already tried using
MAX()
but I get the score of the second value instead of the fourth. What I’m trying to get is a result like:Thanks.
Answer:
You can use group by like this :If you have better answer, please add a comment about this, thank you!