• 【TPCDS】DF的SQL(Data Maintenance部分)


    对应的TPC-DS中的内容如下:

     重要:DF_CS中的删除catalog订单信息、删除catalog退单信息的between '1900-01-02' and '1901-02-01的时间要给定一致,因为他们属于一组,所以时间必须给定一致。(其他的同理)

    ==============执行的SQL如下==============

    -- DF_CS
    -- 删除catalog订单信息
    delete from catalog_sales where cs_sold_date_sk in (select d_date_sk from date_dim where d_date between '1900-01-02' and '1901-02-01');
    -- 删除catalog退单信息
    delete from catalog_returns where cr_order_number in (
    select cs_order_number from catalog_sales where cs_sold_date_sk in (select d_date_sk from date_dim where d_date between '1900-01-02' and '1901-02-01')
    );

    -- DF_SS
    -- 删除store订单信息
    delete from store_sales where ss_sold_date_sk in (select d_date_sk from date_dim where d_date between '1900-01-02' and '1901-02-01');
    -- 删除store退单信息
    delete from store_returns where sr_ticket_number in (
    select ss_ticket_number from store_sales where ss_sold_date_sk in (select d_date_sk from date_dim where d_date between '1900-01-02' and '1901-02-01')
    );

    -- DF_WS
    -- 删除web订单信息
    delete from web_sales where ws_sold_date_sk in (select d_date_sk from date_dim where d_date between '1900-01-02' and '1901-02-01');
    -- 删除web退单信息
    delete from web_returns where wr_order_number in (
    select ws_order_number from web_sales where ws_sold_date_sk in (select d_date_sk from date_dim where d_date between '1900-01-02' and '1901-02-01')
    );

    -- DF_I
    -- 删除仓储
    delete from inventory where inv_date_sk in (select d_date_sk from date_dim where d_date between '1900-01-02' and '1901-02-01');

  • 相关阅读:
    Ubuntu 16.04远程登录服务器--ssh的安装和配置
    设置淘宝源
    shell 循环 read line
    apt-get update 报错 W: Unknown Multi-Arch type 'no' for package 'compiz-core'
    expdp dblink
    ubuntu apt-update NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
    listener.log文件过大导致oracle假死
    rsync_ssh
    ssh多主机
    elk大纲
  • 原文地址:https://www.cnblogs.com/syw20170419/p/16012977.html
Copyright © 2020-2023  润新知