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!

"for XML path " Oracle equivalent of this SQL expression

user6287828May 12 2009 — edited May 12 2009
SELECT TheID,
REPLACE(
RTRIM(
(
SELECT StudentID + ' '
FROM StudentinSchoolLocation TL
WHERE (LocationID = Results.LocationID)
FOR XML PATH ('')
)
),' ',', '
) AS StudentIDs,


What is the equivalent of 'For XML path' used above

The goal is to get a concatenated list of the group by columns. Like where ever the location is same , get the studentIds and make a comma seperated list of all ids for common location

Works perfectly in SQL.

Thank you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 9 2009
Added on May 12 2009
4 comments
14,436 views