I have an oracle database which contains data like employee number, employee's supervisor's employee number, employee name.
I'm looking to extract data from this table in a way such that if I'm selecting the name of the employee and the employee's supervisor's employee number, then how do I go about listing out the supervisor's name in the same query?
For example:
emp_number ---- emp_name ---- emp_supervisor_emp_number
100 ............ abc ............321
200 ............ xyz ............920
321 ............ pqr ............454
920 ............ klk ............344
Now I want to be able to extract data like so (1 level up):
100............ abc ............321 ..... pqr
200............ xyz ............920 ..... klk