table Employee EmpId Name MonthlySalary DateofJoining Suggest a sql server query to find out the employee details whose having salary greater than their yers of experiance
SELECT * FROM Employee WHERE MonthlySalary > DATEDIFF(yy, DateofJoining, GETDATE())
Quote:do you have idea how to find this answer. It is asked to me today in interview.
DateofJoining
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)