duking1991

hive> select * from (select *,row_number() over (partition by id) num from t_link) t where t.num=1;

  

保留crt_time最新的一个数据

select * from (select *,row_number() over (partition by id order by crt_time desc) num from t_link) t where t.num=1;

将查询的去重数据保存到新表t_link2中,新表比源表t_link多一列

insert overwrite table t_link2 select * from (select *,row_number() over (partition by id order by crt_time desc) num from t_link) t where t.num=1;

  

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-02-11
  • 2022-12-23
  • 2021-12-12
  • 2021-12-09
  • 2021-11-29
  • 2021-12-25
  • 2021-11-21
猜你喜欢
  • 2022-02-10
  • 2021-05-16
  • 2021-10-29
  • 2022-12-23
  • 2021-09-07
  • 2021-04-22
相关资源
相似解决方案