MySQL/Hive/Presto/Impala Transposition
Rows to Columns Rows to Comma Separated String
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
FROM: +-----+-----+ | uid | tag | +-----+-----+ | 1 | 1 | | 1 | 2 | | 1 | 3 | | 2 | 1 | | 2 | 4 | | 3 | 5 | +-----+-----+ TO: +-----+----------+ | uid | tag_list | +-----+----------+ | 1 | 1,2,3 | | 2 | 1,4 | | 3 | 5 | +-----+----------+ |
MySQL Use GROUP_CONCAT(). This function also works in Infobright. Incoming search terms:GROUP CONCAT IMPALAhive transposetranspose row to columns in impalaIMPALA transpose ROWS to columnimpala sql for transposeimpala concathive sql transposewrong75uimpala group_concat 去重impala group_concatimpala groupconcatHow to join row values to column names impalaallowcfphive group by column and … Continue reading “MySQL/Hive/Presto/Impala Transposition”