标签:and class 字段排序 status esc mysql success 示例 方法
sql示例如下:
select success_time,query_time,order_no from pro_return_plan t where t.success_time in ( SELECT max(success_time) FROM pro_return_plan WHERE 1=1 AND bill_status=‘2‘ AND success_time IS TRUE AND order_no IN(‘20190416105437690‘,‘20190510193141046‘,‘20190511084814300‘,‘20190703191848850‘,‘20190703193148544‘) GROUP BY order_no ORDER BY success_time DESC )
按照success_time分组并保留最新时间的项
mysql分组统计按照字段排序方法(分组之后保留最新时间、最大id...)
标签:and class 字段排序 status esc mysql success 示例 方法
原文地址:https://www.cnblogs.com/007sx/p/11328367.html