clear markdown compare help best fiddles feedback dbanow.uk
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2805483 fiddles created (40803 in the last week).

create table press_schd ( JOB INT, EST_COMPLETION DATE, INSERT_DATE DATE );
 hidden batch(es)


INSERT INTO press_schd VALUES (111 ,to_date('6/26/2017', 'MM/DD/YYYY'),to_date('5/10/2017', 'MM/DD/YYYY'));
1 rows affected
 hidden batch(es)


INSERT INTO press_schd VALUES (111 ,to_date('7/01/2017', 'MM/DD/YYYY'),to_date('5/11/2017', 'MM/DD/YYYY'));
1 rows affected
 hidden batch(es)


INSERT INTO press_schd VALUES (111 ,to_date('7/5/2017', 'MM/DD/YYYY'),to_date('5/12/2017', 'MM/DD/YYYY'));
1 rows affected
 hidden batch(es)


INSERT INTO press_schd VALUES (222 ,to_date('6/20/2017', 'MM/DD/YYYY'),to_date('5/10/2017', 'MM/DD/YYYY'));
1 rows affected
 hidden batch(es)


INSERT INTO press_schd VALUES (222 ,to_date('6/26/2017', 'MM/DD/YYYY'),to_date('5/11/2017', 'MM/DD/YYYY'));
1 rows affected
 hidden batch(es)


INSERT INTO press_schd VALUES (333 ,to_date('7/26/2017', 'MM/DD/YYYY'),to_date('5/10/2017', 'MM/DD/YYYY'));
1 rows affected
 hidden batch(es)


INSERT INTO press_schd VALUES (333 ,to_date('6/30/2017', 'MM/DD/YYYY'),to_date('5/11/2017', 'MM/DD/YYYY'));
1 rows affected
 hidden batch(es)


INSERT INTO press_schd VALUES (333 ,to_date('8/10/2017', 'MM/DD/YYYY'),to_date('5/12/2017', 'MM/DD/YYYY'));
1 rows affected
 hidden batch(es)


INSERT INTO press_schd VALUES (333 ,to_date('8/6/2017', 'MM/DD/YYYY'),to_date('5/13/2017', 'MM/DD/YYYY'));
1 rows affected
 hidden batch(es)


INSERT INTO press_schd VALUES (333 ,to_date('8/7/2017', 'MM/DD/YYYY'),to_date('5/14/2017', 'MM/DD/YYYY'));
1 rows affected
 hidden batch(es)


SELECT * FROM press_schd;
JOB EST_COMPLETION INSERT_DATE
111 26-JUN-17 10-MAY-17
111 01-JUL-17 11-MAY-17
111 05-JUL-17 12-MAY-17
222 20-JUN-17 10-MAY-17
222 26-JUN-17 11-MAY-17
333 26-JUL-17 10-MAY-17
333 30-JUN-17 11-MAY-17
333 10-AUG-17 12-MAY-17
333 06-AUG-17 13-MAY-17
333 07-AUG-17 14-MAY-17
 hidden batch(es)


SELECT JOB , MIN(EST_COMPLETION) KEEP (DENSE_RANK FIRST ORDER BY INSERT_DATE) , MIN(EST_COMPLETION) KEEP (DENSE_RANK LAST ORDER BY INSERT_DATE) , COUNT(*) FROM press_schd GROUP BY JOB;
JOB MIN(EST_COMPLETION)KEEP(DENSE_RANKFIRSTORDERBYINSERT_DATE) MIN(EST_COMPLETION)KEEP(DENSE_RANKLASTORDERBYINSERT_DATE) COUNT(*)
111 26-JUN-17 05-JUL-17 3
222 20-JUN-17 26-JUN-17 2
333 26-JUL-17 07-AUG-17 5
 hidden batch(es)