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!

Minimum of Two column values

blueoraSep 27 2010 — edited Sep 27 2010
Hi,

I need to update a field based on two fields in a different table.

UPDATE EMP
SET
JOINING_DATE = minimum of join_date_a and join_date_b columns of table EMP_DATA join on EMP_ID

How can I take minimum of two column values (group on EMP_ID)?

Thanks.

PS - An employee can have multiple join_date_a and join_date_b in EMP_DATA.
e.g.

EMP_ID JOIN_DATE_A JOIN_DATE_B
1 01-23-2003 01-20-2004
1 01-24-2003 01-26-2002
1 02-23-2003 01-23-2001
1 04-23-2004 01-20-2005
1 01-23-2002 01-10-2004

Edited by: roboracle on Sep 27, 2010 10:05 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 25 2010
Added on Sep 27 2010
5 comments
13,894 views