oracle相当于hive collect_set函数

时间:2018-05-16 01:51:11

标签: sql oracle hive

以下hive查询的oracle等价物是什么?

select appn_id,collect_set(CONCAT(upper(TRIM(dcsn_type_nm)),':',upper(TRIM(dcsn_outcm_nm))))
 FROM  <left join between few tables>
 group by appn_id  

编辑:

根据戈登的回答更新 -

select appn_id,listagg(upper(trim(dcsn_type_nm)) || ':' || upper(trim(dcsn_outcm_nm))) within group (order by null) set_type_outcm_nm
 FROM  <left join between few tables>
 group by appn_id  

1 个答案:

答案 0 :(得分:1)

我认为使用它的方式相当于listagg()

select listagg(upper(trim(dcsn_type_nm)) || ':' || upper(trim(dcsn_outcm_nm))) with group (order by null)

listagg()是一个聚合函数,因此它组合了来自多行的数据。