Answer the question
In order to leave comments, you need to log in
How to write a query with a selection of unique values?
I have a table ala
uid, data, time
with values
1,7,9
1,7,12
2,6,12
2,9,16
3,4,13
1,3,15
respectively, I want to get unique values for each uid at the maximum time
, that is, the output is:
3,4,13
1,3,15
2,9,16
in the case of one uid - there are no problems - I take max(time) or order by `time` desc limit 1
and with several something the head does not understand.
Thank you in advance
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question