码迷,mamicode.com
首页 > 数据库 > 详细

Mysql Hive 通用的行列转换

时间:2016-08-09 12:05:08      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:

就是简单的一个字符串拼接,意义和所用场景自己体会下

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;

 

Mysql Hive 通用的行列转换

标签:

原文地址:http://www.cnblogs.com/tnsay/p/5752603.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!