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