当前位置:Gxlcms > 数据库问题 > hive数据库如何去重,去除相同的一模一样的数据

hive数据库如何去重,去除相同的一模一样的数据

时间:2021-07-01 10:21:17 帮助过:211人阅读

select count (字段1,字段2) from 表1; 2 3 结果 200条数据 4 5 select count (distinct 字段1,字段2) from 表1; 6 7 结果 100条数据 8 9 相当于后者可以实现查出来去重后的数据 10 11 create table 表1_bak as select distinct 字段1,字段2 from 表1; --备份表数据 12 13 delete from 表1; 14 15 insert into 表1 select * from 表1_bak;

 

hive数据库如何去重,去除相同的一模一样的数据

标签:span   pre   tin   delete   bak   实现   strong   style   原理   

人气教程排行