标签:odi ber ora reserve _id serve row rate blog
按照 某字段分组 某字段排序 然后取出该分组中排第1条数据(每组只取一条)
SELECT* FROM( SELECT a.*,row_number() over(partition by ORI_FEE_ID order by MODIFY_TIME DESC) cn FROM AGENT_RESERVE_FEE_RATE a ) WHERE cn = 1;
- MODIFY_TIME 排序字段
- ORI_FEE_ID 分组字段
- cn 为取值区间
标签:odi ber ora reserve _id serve row rate blog
原文地址:http://www.cnblogs.com/yanlong300/p/7577353.html