数据按某个字段分组,且取每个分组的最大值

来源:互联网 发布:大英帝国 知乎 编辑:程序博客网 时间:2024/04/28 22:20
select 
push_id AS pushId,
device_id AS deviceId,
"timestamp" AS statusTime,
status_type AS statusType 
from (
select ROW_NUMBER() over(partition by status_type order by "timestamp" desc nulls last) RowNum
  ,pamip_status.*
  from pamip_status where push_id ='57c792ad67dc4ec3612da00c' )t where rownum =1
0 0
原创粉丝点击