oracle查询分组数据中的最后一条数据和每组的数量

来源:互联网 发布:五十而知天命 编辑:程序博客网 时间:2024/05/29 13:54

实现代码:

select tmp.* from(    select ROW_NUMBER() OVER(partition by u.id order by u.name) rn,    u.id,    u.name,    u.password pwd    from tb_user u    group by    u.id,    u.name,    u.password)tmpwhere rn = 1
0 0
原创粉丝点击