zoukankan      html  css  js  c++  java
  • Hive数据分析(三)

    数据分析处理

    1、统计每天各个机场的销售数量和销售金额。

    要求的输出字段

    day_id,sale_nbr,,cnt,round

    日期编号,卖出方代码,数量,金额

    (1)、创建jichang表存放信息:

    create table jichang(day_id string,sale_nbr string,cnt string,round string) row format delimited fields terminated by ',';


      

    (2)、在表里插入数据:


     insert into table jichang select day_id,sale_nbr,sum(cnt) as cnt,sum(round) as round from sales_y group by sale_nbr,day_id having sale_nbr like 'C%';

    2、统计每天各个代理商的销售数量和销售金额。

    要求的输出字段

    day_id,sale_nbr,,cnt,round

    日期编号,卖出方代码,数量,金额

    (1)、创建dailishang表存放信息:

    create table dailishang(day_id string,sale_nbr string,cnt string,round string) row format delimited fields terminated by ',';

    (2)、在表里插入数据:

    insert into table dailishang select day_id,sale_nbr,sum(cnt) as cnt,sum(round) as round from sales_y group by sale_nbr,day_id having sale_nbr like 'O%';

  • 相关阅读:
    回家第二周
    回文
    回家第一周
    回家第四周
    《大道至简》读后感
    第三周Java课后题
    Java小测代码及截图
    【CheckBox】选择或取消所有CheckBox
    Web Developer's Handbook
    Oracle PL/SQL
  • 原文地址:https://www.cnblogs.com/znjy/p/15380194.html
Copyright © 2011-2022 走看看