You can use the MAX() function along with the GROUP BY clause to return records with the maximum time in each group when grouping by mpId in MySQL. Here is an example query:

SELECT mpId, MAX(time) AS max_time
FROM your_table
GROUP BY mpId

This will group the records by mpId and return the maximum time value for each group in the max_time column. You can also include other columns in the SELECT statement to retrieve additional data for each group.

return records with maxtime in each group when group by mpId in mysql

原文地址: https://www.cveoy.top/t/topic/fFkr 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录