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!

"Deaggregate" a CSV column, or replace it's contents?

925784Mar 22 2012 — edited Mar 22 2012
This is related to a PowerSchool database using oracle 11g, so everything would need to be done in a select query.

I have a normal table containing student data, with the PK ID, so:

Students
ID LastFirst
1 Some, Student
2 Some, Other student
3 Doe, John
etc...

Another "virtual table" which ends up like this:

VA_MSC
Unique_ID ... Students
1234 1,2,3,4
1235 1,4

The students column in the virtual table is a comma separated list of students.id. I'm trying to figure out how to either:

1. Replace the contents of the va_msc.students column with students.lastfirst in a query's results
2. Create new columns in a queries results for each of the studentIDs listed in va_msc.students

I would need all of this to be done in a select statement.

Any help would be greatly appreciated! Thanks!

Edited by: 922781 on Mar 22, 2012 11:34 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 19 2012
Added on Mar 22 2012
2 comments
389 views