hive sql 数据汇总成数组以及用&&拼接数组中每一个元素

with price_group_01 as(
select
  partner_id,
  collect_set(pgd) as pgd_set
from
  (select distinct
     partner_id,
     concat(division,'-',price_group_description) as pgd
   from
     ccsd.tb_cpp_etl_bp_sales_basic_info
  )
group by partner_id
)
select distinct
  partner_id  as id,
 concat_ws('&&',pgd_set)  as  price_group
from
  price_group_01;

你可能感兴趣的:(hive)