I am working on a EmployeeDetails table. I have 4 columns in that table(Empid,Empname, DateOfJoining, Salary). I want to write a query to fetch the Empid,Empname and salary of the employee who is having Lowest Experience. Can someone please assist me. The query should be written in GRID DB
I have tried this query using a DateADD() function.
I don't think that you need date functions here. As I understand your question, we can just select all employees,
order bydate of joining andlimit:Note that this does not handle ties (if any) in a predictable way. A simple solution is to add another sort criteria to make the results stable:
If you really want the query to return all ties, then we can use window functions instead: