Hello,
i have a table with columns:
employee_id
function_id
start_date
end_date
in this table i can have:
1 1 20/06/2009 21/07/2009
1 2 22/07/2009 29/07/2009
1 3 30/07/2009 null
2 5 20/07/2008 null
i wanna get the oldest start_date for each employee. i tried with
select min(start_date) from angajat_functie where end_date is null and employee_id=2;
so where employee_id =2, this is the single record for this employee, so i returns the start_date.
i wanna for employee_id =1 also to return the oldest start date (just if a record for employee_id=1 contains end_date null). if all end_date for employee_id=1 are null, then that employee is no longer working.
in my case how can i get the oldest date 20/06/2009 for eployee_id=1?
Regards,