You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Oracle SQL - Display rows as columns - Many to Many Relationship

edited Apr 25, 2021 10:21AM in Reporting and Analytics for HCM 2 comments

Summary

Oracle SQL - Display rows as columns - Many to Many Relationship

Content

Good day! I need some guidance if I want to do is actually possible in Oracle SQL.

I have a table like this:

ID Name Code
999 Abby 1
999 Betty 1
999 Cass 2
999 Diane 2
999 Elly 2
999 Faye 3
999 Greg 4
999 Honey 4
999 Iman 4
999 Jam 4
999 Klade 5

And I want to achieve something like this:

ID ----- 1 ------------ 2 --------- 3---------- 4---------- 5----------
999----- Abby---------- Cass------- Faye------- Greg------- Klade------
999----- Betty--------- Dianne----- ----------- Honey------ -----------
999----- -------------- Elly------- ----------- Iman------- -----------
999----- -------------- ----------- ----------- Jam-------- -----------

I have tried joins, pivots, aggregates, but nothing seems to possibly work out (as far as I tried it.) I even tried getting all the raw data and creating a new table but the only id I can reference them with is the ID.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!