Find the difference between the salary of an employee and max salary of the employee in the department

etldevloper
1 Min Read
Find the difference between the salary of an employee and max salary of the employee in the department

Find the difference between the salary of an employee and max salary of the employee in the department

SELECT Employee_Id,

       First_Name,

       Department_Id,

       Salary,

       MAX(Salary) OVER(PARTITION BY Department_Id ) as MAX_SAL,

       (MAX(Salary) OVER(PARTITION BY Department_Id )-Salary ) as SAL_DIFF

FROM EMPLOYEES

ORDER BY Employee_Id;

In the above query, MAX_SAL represents the maximum salary of an employee in that department. SAL_DIFF gives the difference between the Max salary in the department and the salary of the employee.

Also Read :

What is a Synchronization task in Informatica?

What is a Runtime environment in Informatica?

What is Check In Check Out in Informatica powercenter (Versioning)

Filter transformation in Informatica?

Share This Article
Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *