0
我的查詢顯示兩條結果。Oracle查詢 - 將多個結果合併成一行
查詢:
select /*+ parallel(16) */ * from CONTRACT where CONTRACT_ID ='1234';
結果:
_____________________________________________________________________________________
|CONTRACT_SOURCE | CONTRACT_ID | ROLE | ROLE_ID | STD_CD | INDEX
_____________________________________________________________________________________
|Source | 1234 | role_driver | unique1 | LOAD | 9
|Source | 1234 | role_insured| unique2 | LOAD | 9
_____________________________________________________________________________________
我想獲取這些結果合併,在下面的格式。
_____________________________________________________________________________________________________________________
|CONTRACT_SOURCE | CONTRACT_ID | ROLE | ROLE_ID | ROLE | ROLE_ID | STD_CD | INDEX |
_____________________________________________________________________________________________________________________
|Source | 1234 | role_driver | unique1 | role_insured | unique2 | LOAD | 9 |
_____________________________________________________________________________________________________________________
我可以通過Oracle查詢來實現嗎?
會有每contract_id只有兩個角色? – GurV
是@GurV!正是 – Nidheesh