准备数据:
name | constellation | blood_type |
---|---|---|
小明 | 小熊座 | R |
小红 | 猎户座 | XR |
小白 | 猎户座 | R |
小蓝 | 小熊座 | R |
小绿 | 小熊座 | R |
行转列
创建表并导入数据
create table person_info(
name string, constellation string, blood_type string)
row format delimited fields terminated by "\t";
//导入数据
load data local inpath '/home/datas/a.txt' into table person_info;