ORALCE 开窗函数求分类后每类前几条数据

select tId,tName,tType,endTime
from
(select tId,tName,tType,endTime,
row_number() over(partition by tType order by endTime desc) rn
from test1) a
where rn<=2


你可能感兴趣的:(ORALCE 开窗函数求分类后每类前几条数据)