1. 程式人生 > >hive 分組topN

hive 分組topN

select id,sex,age,hobby from t1 group by sex order by age

row_number() over (partition by sex order by age asc) as od;


select * from t_tmp where od>3

row_number為hive內建函式,partition 按哪一組分