Hi this code gives me employee salaries and manager salaries.
SELECT E.EMP_FNAME AS MANAGER, E.EMP_SALARY, D.DEPT_NO, A.EMP_FNAME AS EMPLOYEE, A.EMP_SALARY
FROM EMPLOYEE E, EMPLOYEE A, DEPARTMENT D
WHERE E.EMP_NIN = A.EMP_MANAGER
AND A.EMP_MANAGER = D.EMP_MANAGER;
![alt text][1]
How can i only show the employees that have a salary within 10% of their manager salary?
Assuming you want to allow for employees earning more than their managers (you know it would happen, in a different, better world) just include this in the WHERE clause:
edit
This uses simple mathematics. 0.9 = 90% and 1.1 = 110%; this line restricts the resultset to EMPLOYEE records where the SALARY is with +/- 10% of their manager’s SALARY. If you are certain that employees can never earn more than their manager then you need a simpler greater than test…