-- 列转行
select
id,
concat_ws(',',collect_set(money_01)) money_02
from
(
-- 行专列
select
id,
money_01
from test -- 表名
lateral view explode(split(money,',')) tmp as money_01
)a
group by id
HQL行列转换
于 2023-02-23 16:12:03 首次发布
-- 列转行
select
id,
concat_ws(',',collect_set(money_01)) money_02
from
(
-- 行专列
select
id,
money_01
from test -- 表名
lateral view explode(split(money,',')) tmp as money_01
)a
group by id