Hi Team, We have 1 entity in which employee details are present like employee name ,employee no,comp code,employee superior etc I want a OQL query to check all employees whose employee superior's company code is different than the employee company code. In the emp superior field Employee no of Superior is stored in our entity , Please Help me.
How about this for a start:
FROM yourmodule.Employee AS e
JOIN yourmodule.Employee AS s
ON e.EmployeeNumber = s.SuperiorEmployeeNumber
WHERE not(e.CompanyCode =s.CompanyCode)