原文: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