简体   繁体   English

将LISTAGG输出与其他列连接

[英]Concatenate the LISTAGG output with other columns

I need to concatenate the outputs in same query. 我需要在同一查询中连接输出。 Is it possible to do this? 是否有可能做到这一点?

Example query: 查询示例:

Concat(c.manames,a.transaction_amt_us) as concat listagg(i.settlement_type,',')within group (order by i.settlement_type) as settlement_type,

I want to concatenate both outputs ie concat and settlement_type and get in one column. 我想连接两个输出,即concat和沉降类型,并进入一列。

something like: Concat(concat,settlement_type) 像这样: Concat(concat,settlement_type)

Help me resolve this. 帮我解决这个问题。

Of course. 当然。 Just use || 只需使用|| :

(c.manames || a.transaction_amt_us) ||
 listagg(i.settlement_type,',')within group (order by i.settlement_type)
) as AllTogether

You can do this with concat() , but you need to call it twice: 您可以使用concat()进行此操作,但需要调用两次:

concat(concat(c.manames, a.transaction_amt_us),
       listagg(i.settlement_type,',')within group (order by i.settlement_type)
      ) as AllTogether

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM