美文网首页
2017.02.23

2017.02.23

作者: 辉格食品 | 来源:发表于2017-03-29 10:37 被阅读0次

    优朋星娱乐和大片五分熟数据导出

    大片五分熟

    1238113941,8

    1158036262,8

    1204913540,9

    1154250874,9

    43697919,9

    64522329,9

    49363425,9

    2688609,10

    16749731,10

    53364088,10

    52803414,11

    86236435,11

    76934847,11

    1227405843,11

    1191868932,11

    CREATE TABLE `2yy`(

    `dim_movie_mid` string,

    `mtype` string

    )

    ROW FORMAT DELIMITED

    FIELDS TERMINATED BY ','

    LINES TERMINATED BY '\n';

    load data local inpath '2yy.txt'into table 2yy;

    导出数据

    selecttmm.mtypecount,sum(if(tmm.busmode=1,1,0)),sum(if(tmm.busmode=2,1,0)) from

    (

    selecttm.dim_user_hid,tm.busmode,count(distinct tm.mtype) as mtypecount from

    (selectt.mtype,m.dim_user_hid,collect_set(m.dim_oem_busmode)[0] as busmode from 2yy tjoin fact_vod_cube m on t.dim_movie_mid=m.dim_movie_mid wherem.day>='2016-01-01' group by t.mtype,m.dim_user_hid) tm group bytm.dim_user_hid,tm.busmode

    ) tmm group by tmm.mtypecount;

    优朋星娱乐导出:(由于我建的是1yy)

    selecttmm.mtypecount,sum(if(tmm.busmode=1,1,0)),sum(if(tmm.busmode=2,1,0)) from

    (

    select tm.dim_user_hid,tm.busmode,count(distincttm.mtype) as mtypecount from

    (selectt.mtype,m.dim_user_hid,collect_set(m.dim_oem_busmode)[0] as busmode from 1yy tjoin fact_vod_cube m on t.dim_movie_mid=m.dim_movie_mid wherem.day>='2016-01-01' group by t.mtype,m.dim_user_hid) tm group bytm.dim_user_hid,tm.busmode

    ) tmm group by tmm.mtypecount

    相关文章

      网友评论

          本文标题:2017.02.23

          本文链接:https://www.haomeiwen.com/subject/dmdtottx.html