原文:Mongo 分组后排序取时间最大的一整条数据对象

db.getCollection product protocol new .aggregate sort: end date : , group: id: company protocol , end date: first : ROOT , ...

2018-08-16 09:28 0 1158 推荐指数:

查看详情

mysql分组取时间最大的记录

要求:获得 按table1_id分组,并且age最大的记录信息,即2、3、5条 方法一: select * from (select * from table2 order by age desc) as a group ...

Thu Nov 15 01:56:00 CST 2018 0 1008
oracle 分组中获取时间最新的一条数据

分组中获取时间最新得一条数据 解析:根据APP_LID分组,按照FINISH_TIME不为空倒叙排序,mtime取分组排序在第一位的数据 SELECT * FROM ( SELECT ROW_NUMBER () OVER ( PARTITION BY APP_LID ...

Thu Sep 24 02:03:00 CST 2020 0 4850
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM