by-if-then do-if-first-then-delete:如何在配置单元中写入此内容?

fquxozlt  于 2021-06-24  发布在  Hive
关注(0)|答案(1)|浏览(395)

我怎么在Hive里写这个?此表有重复项,基于第一个唯一列,我想从新表中排除重复记录。

data new;
    set old;
    by Col_1  Col_2date  Col_3date;

    if Col_2date ^=  Col_3date then do;
        if first.Col_3Date ^= 1 then delete;
    end;
run;
qjp7pelc

qjp7pelc1#

以下内容如何:

select min(Obs)  as Obs, Col_11, Col_2date, Col_3date
  from your_table
 group by Col_11, Col_2date, Col_3date

相关问题