Gets the method of each UserId last record in MySQL table
The following table:
The data is as follows:
Where the userid is not unique, it is required to take a record with the time corresponding to each userid in the table closest to the present.When I first see this condition, I usually think of borrowing a temporary table and adding a main building with the help of join operations.
Give a short method: