no seq_no station time
select * from tbname
where (no,seq_no) in (select no,max(seq_no) from tbname
group by no);
select * from tbname
where (no,seq_no) in (select no,max(seq_no) from tbname
group by no);
解决方案 »
- 关于在linux下卸载oracle10g的问题
- 急~~~小问题
- oracle ORA-02287: 此处不允许序号 的问题
- 装了oracle9i企业版,企业管理器中很多功能都无法使用
- PQL控制oracle语句
- 用优化大师清理注册表后,Oracle不能用了,怎么解决?
- 一个视图的写法,在线急等,多谢
- 请教一句非常简单的SQL
- 求IBM/AIX下双机备份下的Oracle安装方法策略???
- 安装oracle ebs R12.2时候遇到的问题
- 问一个数据库sql问题:在sybase中,可以采用like '[A-Z]%' 匹配以A-Z字母开头的字符串,oracle中如何写?
- 请问oracle怎样在sql语句中将小时转化为小时:分:秒?
where (no,seq_no) in (select no,max(seq_no) from tbname
group by no);
from (
select no,seq_no,station,time,
row_number() over (partition by no order by seq_no desc) rn
from table1
)
where rn = 1;
select
no,
first_value(seq_no) over (partition by no order by time desc rows unbounded preceding) lastseq_no,
first_value(station) over (partition by no order by time desc rows unbounded preceding) laststation,
first_value(time) over (partition by no order by time desc rows unbounded preceding) lasttime
from tabname);