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 Multiple columns to one Row - Oracle 10.1

Diwakar DayalanApr 13 2010 — edited Apr 19 2010
Hi Friends,

I have the item id in the item table and list of warehouses in another table.

SDM_ITEM_TABLE
ITM_ID ITM_DESC
1 Baby Oil
2 Shampoo

SDM_OUTBOUND_LOG
ITM_ID WHS_ID
1 1
1 2
1 3
1 4

2 1
2 2

SDM_OUTBOUND_DESC
WHS_ID WHS_SNAME
1 NJ
2 WN
3 CA
4 CN

Expected Result
ITM_ID WHS_SNAME
1 NJ WN CA CN
2 NJ WN

I am using the below query to join the above 3 tables , but i am unable to concatenate the warehouse short names as displayed above.

select t.itm_id,(SELECT H.WHS_SNAME FROM SDM_OUTBOUND_DESC H WHERE H.WHS_ID = t.WHS_ID) WHS_SNAME
from SDM_OUTBOUND_LOG t, SDM_ITEM_TABLE i
where t.itm_id = i.itm_id

Please let me know how to proceed further in modifying the query to concatenate the warehouse names.

Thanks
This post has been answered by Hoek on Apr 14 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 17 2010
Added on Apr 13 2010
5 comments
3,665 views