Skip to content
Advertisement

How to get just one result when using MAX and GROUP BY

I would love some help on this query:

Here’s what I get:

enter image description here

I’m trying to fetch only the result with the biggest move_number of these two. With a MAX(move_number) it would work, but I also need other information, specifically the data in the Moved_On column.

I’m trying to make it work with this query but it doesn’t work :

But this shows basically the same result as the previous query :

enter image description here

Thanks.

Advertisement

Answer

Looks like you want top(1)

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement