select order_id,order_sn,coupon_sn,coupon_sn_new
from 表A
LATERAL VIEW
EXPLODE(split(coalesce(coupon_sn,'未用券'),',')) tmp AS coupon_sn_new
;
SQL实现列转行
最新推荐文章于 2024-09-05 12:12:30 发布
select order_id,order_sn,coupon_sn,coupon_sn_new
from 表A
LATERAL VIEW
EXPLODE(split(coalesce(coupon_sn,'未用券'),',')) tmp AS coupon_sn_new
;