Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

concatenate result of a select statement result inside a select statement

Rakesh119Jul 22 2020 — edited Jul 22 2020

There are 2 tables linked by incident number.

When the main table is updated there is a notes column which can be updated and updated content of the notes is written to the 2nd table along with the primary key which here is INCIDENT NUMBER, second table can take mulitiple notes for a INCIDENT NUMBER.

I want to write a query which will have all the rows from the man table and NOTES column from the 2nd table but as there can be mutiple notes for a INCIDENT i want to concatenate all the notes for a INCIDENT

For Example MAIN TBALE

INCIDENT NUMBER
Header 4Header 5
INC00001234some datasomedata
INC00001235some datasome data

2nd Table

INC_NUMBER
Notes
INC00001234note 1
INC00001234note 2

When the o/p comes it should be like

Header 1Header 2Header 3Notes
INC00001234some datasome data

note 1

note 2

INC00001235some datasome data

Please help.

Thanks

Rakesh

This post has been answered by Solomon Yakobson on Jul 22 2020
Jump to Answer
Comments
Post Details
Added on Jul 22 2020
3 comments
272 views