Skip to content
Advertisement

Is it possible to join a table to itself

I have a query that joins two tables together. In table O I have an employee ID, which I join to the HR table to retrieve the employee name:

Also on the HR table is the employees manager, but the value is only the employee ID of the manager. Therefore to retrieve the full name of the manager, would I need to use a self join? I could only find examples of self join using the FROM table, in this case it’s the join table.

Any help would be appreciated.

Advertisement

Answer

You can sure bring the same table twice – you just need to use a different alias.

I think that you want:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement