Fork me on GitHub
摘要: 在项目开发中,有时候会遇到“查找依据特定字段分组后,排序topX的数据”这样的需求,在这种情况下,通过sql语句的分组排序即可解决。 postgres数据库 pg自带函数即支持 row_number() over(partition by 分组字段 order by 排序字段 desc) 例如以下, 阅读全文
posted @ 2020-09-02 18:53 ayueC 阅读(1122) 评论(0) 推荐(0)