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分组并保留最新时间的项
原文地址:https://www.cnblogs.com/007sx/p/11328367.html
时间: 2024-10-09 01:00:02