By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
4 rows affected
SEL_EMP_ID | REL_EMP_ID | RELATION | DEPTH_LVL |
---|---|---|---|
1 | 100 | My Mgr | 1 |
1 | 1 | Self | 0 |
1 | 2 | My Reportee | -1 |
1 | 3 | My Reportee | -2 |
2 | 100 | My Mgr | 2 |
2 | 1 | My Mgr | 1 |
2 | 2 | Self | 0 |
2 | 3 | My Reportee | -1 |
3 | 100 | My Mgr | 3 |
3 | 1 | My Mgr | 2 |
3 | 2 | My Mgr | 1 |
3 | 3 | Self | 0 |
100 | 100 | Self | 0 |
100 | 1 | My Reportee | -1 |
100 | 2 | My Reportee | -2 |
100 | 3 | My Reportee | -3 |