一、数据准备
store.txt数据:
名称,月份,资金
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
二、创建表:
create table t_store(
name string,
months int,
money int
)
row format delimited fields terminated by ",";
三、加载数据:
load data local inpath "/home/atguigu/datas/store.txt" into table t_store;
四、结果展示:
五、需求实现: