2014-10-30 31 views
0

我需要連接相同查詢中的輸出。是否有可能做到這一點?將LISTAGG輸出與其他列連接起來

例子查詢:

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

我想連接兩個輸出即CONCAT和settlement_type和一列得到。

類似: Concat(concat,settlement_type)

幫我解決這個問題。

回答

1

當然。只需使用||

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

你可以用concat()做到這一點,但你需要兩次調用它:

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

感謝戈登,我想這已經,但它沒有工作。我有一個用於其他列的'listgg',但不需要連接。這是問題嗎? – Prash 2014-10-30 12:21:38

+0

這不行嗎? – 2014-10-30 12:24:07

+0

我的意思是沒有檢索到數據。沒有應用這個,我得到1635行。 – Prash 2014-10-30 12:26:40

相關問題