在greenplum中删除重复数据

在PostgreSQL中,可以借助ctid变量删除重复数据:postgresql: 使用SQL删除重复数据,但在GreenPlum中,由于数据是分散到不同的segment上,因此仅使用ctid无法删除重复数据了,需要借助pg_segment_id来解决。

参考了这篇文章:http://www.cnblogs.com/kuang17/p/5861700.html,最终解决方法就是:

delete from taxi_2010_dup where (gp_segment_id,ctid) not in (select gp_segment_id,min(ctid) from taxi_2010_dup group by tid,gpstime,gp_segment_id);

在实际测试过程中,发现上述sql有时删除重复数据不彻底,还是这种办法好:

DELETE FROM dupes T1
    USING   dupes T2
WHERE   T1.ctid < T2.ctid  -- delete the older versions
    AND T1.key  = T2.key;  -- add more columns if needed

已发布

分类

来自

评论

《 “在greenplum中删除重复数据” 》 有 13 条评论

  1. how to order enclomiphene generic ireland

    cheap enclomiphene buy adelaide

  2. commande kamagra sans rx

    acheter kamagra ligne a bon franche comte

  3. get androxal cost per tablet

    canadian androxal pharmacy

  4. discount flexeril cyclobenzaprine generic does it works

    buy flexeril cyclobenzaprine australia cheap

  5. buying dutasteride without a script

    order dutasteride usa buying

  6. over the counter fildena alternative

    cheap fildena generic canada no prescription

  7. get gabapentin cheap prices

    buy gabapentin mastercard buy

  8. how to get womens itraconazole and how much is it

    ordering itraconazole generic drug

  9. No r x needed for purchasing staxyn

    discount staxyn buy adelaide

  10. cheap avodart buy sydney

    purchase discount avodart no rx

  11. online order xifaxan cost tablet

    order xifaxan for sale usa

  12. cheap rifaximin purchase in australia

    order rifaximin cheap with fast shipping

  13. koupit kamagra bez pナ册dpisu platit

    comprar kamagra en espana

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注