I need to get fname, lname, salary of employees who are $400.00 below the average salary even after geting a 10% salary raise.
I\'m able to get employees who\'s salary i
You have the right idea, you just can't use aliases in the where
clause like that. Just use the formula directly, and you should be fine. Also, you should probably use <=
, and not =
:
select Fname, Lname, Salary, 1.10 * Salary as NewSalary
from employee
where 1.10 * Salary - (select AVG(salary) from employee) <= 400;