网站建设资讯

NEWS

网站建设资讯

Hive求月销售额和总销售额

求月销售额和总销售额
a,01,150
a,01,200
b,01,1000
b,01,800
c,01,250
c,01,220
b,01,6000
a,02,2000
a,02,3000
b,02,1000
b,02,1500
c,02,350
c,02,280
a,03,350
a,03,250

十多年的子洲网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。营销型网站建设的优势是能够根据用户设备显示端的尺寸不同,自动调整子洲建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。成都创新互联从事“子洲网站设计”,“子洲网站推广”以来,每个客户项目都认真落实执行。

create table t_store(
name string comment '店铺',
months int comment '月份',
money int comment '金额'
)
row format delimited fields terminated by ",";
load data local inpath "/root/t_store.txt" into table t_store;

create view v_t_store
as
select name,months,sum(money) money
from t_store
group by name,months;

select name,months,money
,sum(money) over(partition by name order by months rows between unbounded preceding and current row) as t_money
from v_t_store;

a 1 350 350
a 2 5000 5350
a 3 600 5950
b 1 7800 7800
b 2 2500 10300
c 1 470 470
c 2 630 1100


当前题目:Hive求月销售额和总销售额
文章链接:http://njwzjz.com/article/jjioeg.html