Click here to Skip to main content
15,892,199 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Emp-Salary                Emp-Bonous

EID       salary           EID                salary
111       10000            111                5000
222       20000            111                2000
333       40000            222                10000
444       30000            333                8000


if Employee is Getting Bonous then need to Remove that bonous from salary and generate the new salary from Emp-Salary Table.


can anyone help with this with sql query


What I have tried:

I have used SQL regular expressions
Posted
Updated 30-Oct-18 20:30pm
Comments
Richard Deeming 2-Nov-18 12:38pm    
NB: The word is "bonus", without the second "o". :)

1 solution

Try:
SQL
SELECT s.EID, s.Salary - b.Salary AS AdjustedSalary
FROM [Emp-Salary] s
JOIN [EMp-Bonous] b ON s.EID = b.EID
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900