如下图:
1、列转行,即table1查询出table2
select
`order_id`,
concat_ws(',', collect_list(`item_sku_id`))
from
table1
group by
`order_id`;
2、行转列,即table2查询出table1
select
`order_id`,
`item_sku_id`
from
table2 lateral view explode(split(item_sku_id), ',') as table as item_sku_id;