hive 两张表全量数据对比

hive 两张表全量数据对比

select
 *
  from (
        select max(source) source,c1,c2 ,c3,count(*)
          from (
                select 1 source, a.* from dev.astron_wangluochayi_1 a 
                union all
                select 2 source, b.* from dev.astron_wangluochayi_1 b
               ) merged_data
        group by source,c1,c2 ,c3
        having count(*) = 1
       ) minus_data
 where source = 1

你可能感兴趣的:(hive,其他)