标签:and 成绩 images des http lang 排名 tab ima
答案:
hive> select *,row_number() over (partition by product_no order by start_time desc) from table1;
知识点:
hive (test)> select *, row_number() over (partition by sub order by score) as od from t;
hive (test)> select *, rank() over (partition by sub order by score) as od from t;
hive (test)> select *, dense_rank() over (partition by sub order by score desc) from t;
select * from (select *, row_number() over (partition by sub order by score desc) as od from t ) t where od<=3;
hive (test)> select od from (select *, row_number() over (partition by sub order by score desc) as od from t )t where sub=‘chinese‘ and score=80;
hive (test)> select * from (select *, row_number() over () as rn from t) t1 where rn between 1 and 5;
标签:and 成绩 images des http lang 排名 tab ima
原文地址:http://www.cnblogs.com/duking1991/p/6126745.html