关于最后一题的第10个填空,我认为不能只有一个空,所以在这个空里我填了10-1,10-2,10-3

    我的疑惑是,怎么算一个一个子查询计算完毕,我最后观察,觉得当该查询出现select部分的时候,就算查询完毕了
    所以根据这点,我在第三个里填写了三个部分。但是为什么题目只有一个空???

    — 拆解步骤如下,请将下列横线处拆解内容补充完整

    — 以下题4个空,每空10分

    1.from kps_dwd.kps_dwd_dd_view_user_active

    2.where dt=’${dt_1}’

    3.select

    1. dt
    2. ,product_id
    3. ,st_time
    4. ,device_id

    4.from

    1. (……) a0

    5.left join

    1. (select
    2. dt
    3. ,mkey
    4. ,device_id
    5. from kps_dwd.kps_dwd_dd_user_channels
    6. where dt='${dt_1}'
    7. ) a1
    8. on a0.device_id = a1.device_id

    6.__

    7.select

    1. dt
    2. ,product_id
    3. ,mkey
    4. ,hour
    5. ,device_id
    6. ,'active' as status
    7. from temp_active_hour_table_kps
    8. group by dt,mkey,product_id,device_id,hour

    8.__

    9.from

    1. (……) a

    10.__

    11.from

    1. (select
    2. dt
    3. ,'K-pop' as product
    4. ,product_id
    5. ,mkey
    6. ,hour
    7. ,status
    8. ,count(distinct a.device_id) as dau
    9. ,count(distinct if(b.device_id is not null,a.device_id,null)) as new
    10. ……
    11. group by dt
    12. ,product_id
    13. ,mkey
    14. ,hour
    15. ,status
    16. ) a1

    12.__

    13.select

    1. dt
    2. ,product
    3. ,product_id
    4. ,a1.mkey
    5. ,name_cn
    6. ,hour
    7. ,status
    8. ,dau
    9. ,new