🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] # 行转列 创建表 ~~~ hive (db1)> create table person_info( > name string, > constellation string, > blood_type string) > row format delimited fields terminated by "\t"; ~~~ 数据 ~~~ 孙悟空 白羊座 A 大海 射手座 A 康师傅 白羊座 B 猪八戒 白羊座 A 凤姐 射手座 A ~~~ 导入数据 ~~~ load data local inpath "/root/study/person_info.tsv" into table person_info; ~~~ sql ~~~ select t1.base, concat_ws('|', collect_set(t1.name)) name from ( select name, concat(constellation, ",", blood_type) base from person_info ) t1 group by t1.base; ~~~