There is a table
If I make the following request
SELECT DISTINCT id_event FROM mes LEFT JOIN searchjur ON mes.id_event = searchjur.id WHERE to=58 ORDER BY t5ime_mes DESC LIMIT 20 then my sample is as follows. First, it selects all the unique id_event values, and then sorts the result of this selection by the t5ime_mes field, and how to make the sample go down the t5ime_mes field, but take the unique values of the id_event field? Tried to do
SELECT `id`, `id_event`, max(`t5ime_mes`) FROM ( SELECT * FROM `mes` ORDER BY `t5ime_mes` DESC ) as `new_table` GROUP BY `id_event` but it also did not give a positive result

select id_event, max(t5ime_mes) from .... group by id_event- Mikeid_event, max (time_mes) FROMmesLEFT JOINsearchjurONmes.id_event=searchjur.idWHEREto= 58 GROUP BYid_eventDESC ORDER BYt5ime_mes- Victor Vasiliev