hive 全表全字段对比

 1 select
 2     *
 3 from (
 4     select 
 5          max(t1.source) as source
 6         ,t1.c1
 7         ,t1.c2 
 8         ,t1.c3
 9         ,count(*) as cnt
10     from (
11         select 1 source, t11.* from dev.astron_wangluochayi_1 t11
12         union all
13         select 2 source, t12.* from dev.astron_wangluochayi_1 t12
14     ) t1
15     group by t1.source,t1.c1,t1.c2 ,t1.c3
16     having count(*) = 1
17 ) t2
18 where t2.source = 1
19 ;

未完待续

猜你喜欢

转载自www.cnblogs.com/chenzechao/p/9444191.html
今日推荐