Member since
08-15-2017
2
Posts
2
Kudos Received
0
Solutions
11-03-2017
11:19 AM
2 Kudos
Hi. collect_list should be able to achieve what you want: select id
,name
,dob
,concat_ws(',',collect_list(location)) as location
from test_analysis
group by id
,name
,dob
I found the solution here: https://stackoverflow.com/questions/44770037/hive-pivot-and-sum Output should look like this: 1 Bob 08/10/1985 New Jersey,New York,North Carolina
2 John 26/11/1990 Oklahoma
Hope this helps.
... View more