Search code examples
sqloracle-databasenorthwind

SQL, Beginner issues with Northwind Database exercises


I am a beginner in SQL so I don't know how to approach this problem. It's Northwind related, done with Oracle. I have a table of employees, and each employee has another employee's ID as a Manager (i.e the person the employee reports to):

I need to flip it around so that instead of an employee having a manager, the manager should have a list of subordinates in a single cell.

How should I approach this? I have no idea...


Solution

  • You could concatenate them into a cell but I am unsure as to if that is what you want or what use data in that form would be. You want data to be in separate cells from each other.

    Here is also an example of an oracle solution. https://stackoverflow.com/a/9621167