hive的rownumber()的使用
举个简单的栗子:
找到最小日期的那一条记录
select * from (
select
*,
row_number() over (partition by id order by cast(date as bigint) asc ) date_row_number
from ods_sdm.sdm_xxx ) t where t.date_row_number = 1;
举个简单的栗子:
找到最小日期的那一条记录
select * from (
select
*,
row_number() over (partition by id order by cast(date as bigint) asc ) date_row_number
from ods_sdm.sdm_xxx ) t where t.date_row_number = 1;