Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

get oldest date

Roger25Jun 11 2009 — edited Jun 11 2009
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,
This post has been answered by SeánMacGC on Jun 11 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 9 2009
Added on Jun 11 2009
6 comments
636 views