OQL to get employee category

0
Hello! We have a entity in which employee No , Employee superior No, Employee Category and other details are there. We have a requirement that for particular employee Let's Say A we have to find his Employee superior with some defined Emp category if it is not found then we have to find superior's superior till the time we don't get that particular category how to write a recursive OQL for the same. Any help will be appreciated Thanks in Advance        
asked
1 answers
0

Hi Sharad,

 

You can do something like this:

 

SELECT EMP.No No,
       SUP.Name SupName

FROM Employee.Employee EMP

LEFT JOIN EMP/Employee_Superior/Superior SUP

 

And if you want to get only the employees where superior is filled in you use INNER JOIN instead of LEFT JOIN

 

 

Kind regards,
Steven

answered