当前位置:网站首页>oracle分组取最大值
oracle分组取最大值
2022-07-27 22:39:00 【贾斯汀_abc】
比如表 test
| recid | listid |
| 1 | 1 |
| 1 | 2 |
| 2 | 3 |
| 2 | 7 |
| 1 | 4 |
想得到的数据是按照listid分组,然后取出每组中recid最大的那几条纪录。
结果应该是这两条纪录:
字段:listid recid
1 2
2 5
SQL如下:
select listid,recid
from ( select listid,recid,row_number() over(partition by listid order by recid desc) rn
from test)t1 where rn=1;边栏推荐
- Sign up now | cloud native technology exchange meetup Guangzhou station has been opened, and I will meet you on August 6!
- 进程与进程调度
- One year anniversary of creation, Chongba young Lang
- uni-app进阶之样式框架/生产环境
- MySQL中的运算符
- Postman download and use tutorial
- Jerry Zhi has problems in real-time adjustment of sound change effect in magic sound mode [chapter]
- Recommended system - offline recall: u2tag2i, ICF
- Uniapp display rich text effect demo (organize)
- 多线程及多线程程序的编写
猜你喜欢

Ink wheel salon | Li Wenjie, Peking University: a graph database system for knowledge atlas application gstore

怎么清晰地理解、表达 IaaS 、 PaaS 、 SaaS ?

The most detailed summary of common English terms in the chip industry (quick grasp of graphics and text)

跨桌面端Web容器演进

Demo: the test interface receives duplicate data and creates documents in a short time

福特SUV版“野马”正式下线,安全、舒适一个不落

DEMO:测试接口短时间内接收重复数据创建单据

How to clearly understand and express IAAs, PAAS and SaaS?
![[CruiseControl]Build Result JSP](/img/80/11c2b539c217ecd6ba55668d3e71e9.png)
[CruiseControl]Build Result JSP

Code random notes_ Hash_ 1002 find common characters
随机推荐
Leetcode:1997. the first day after visiting all rooms [jump DP]
C language programming | single dog topic explanation
Programmer growth Chapter 30: do you really understand feedback?
Can TSMC Samsung build a production line without American equipment for Huawei?
node-red与TDengine交互
Srv6 debut
估值360亿美元!即将进行首次载人发射的SpaceX筹资3.46亿美元
[BuildRelease Management]Parabuild
Postman 的使用
Focus on demand flow rather than idle people
uniapp显示富文本效果demo(整理)
【C语言入门】ZZULIOJ 1026-1030
网络设备硬核技术内幕 防火墙与安全网关篇 (八) 虚拟化神器 (中)
Red team killer behinder_ V4.0 (ice scorpion 4.0)
Focal Loss讲解
Recommended system - offline recall: u2tag2i, ICF
立即报名 | 云原生技术交流 Meetup 广州站已开启,8 月 6 号与你相遇!
Uniapp display rich text effect demo (organize)
Analysis and recurrence of network security vulnerabilities
DC motor winding parameters