Mysql Hive 通用的行列转换
就是简单的一个字符串拼接,意义和所用场景自己体会下 insert into table agent_library1 select concat_ws(':',collect_set(name)) as name,contact,concat_ws(':',collect_set(company)) as company,concat_ws(':',collect_set(stores))as stores,concat_ws(':',collect_set(city)) as city,concat_ws(':',collect_set(street)) as street from (select name,company,city,concat_ws(':',collect_set(contact)) as contact,concat_ws(':',collect_set(stores))as stores,concat_ws(':',collect_set(street)) as street from agent_character1 group by name,company,city)a group by a.contact;
转载注明出处
如果本文对你有帮助,请帮忙啦~~
打开支付宝首页搜“522901509”领红包,领到大红包的小伙伴赶紧使用哦!