Link to home
Start Free TrialLog in
Avatar of cookiejar
cookiejarFlag for United States of America

asked on

Get max date or null date - ORACLE 11g

How would I construct a SQL to get the this result
RESULT:

 TASK1    IN_PROGRESS
 TASK2    ASSIGN
 TASK3    COMPLETE

INPUT:
P_ID    TITLE    COMPLETE_DATE    STATUS
1         TASK1    01/01/2011             COMPLETED
1         TASK1                                   IN_PROGRESS

P1_ID   TITLE    COMPLETE_DATE   STATUS
1          TASK2                             ASSIGN


PI_ID   TITLE    COMPLETE_DATE    STATUS
 1      TASK3     01/01/2012             CLOSE-OUT
 1      TASK3     07/23/2012             COMPLETED
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

If the post above with nvl(complete_date, sysdate) does not answer the question:

I'm not understanding the inputs/outputs.

I see what looks like three sets of inputs and no expected results.

Please post expected results.
Avatar of cookiejar

ASKER

The results were posted:

RESULT:

 TASK1    IN_PROGRESS
 TASK2    ASSIGN
 TASK3    COMPLETE


AngelIII's solution  works well.