Solved

oracle query

Posted on 2015-02-05
4
240 Views
Last Modified: 2015-02-05
CREATE TABLE TAB_NEW
(
  DRIVE_DATE         DATE                       NOT NULL,
  DRIVE_ID           NUMBER(7)                  NOT NULL,
  START_TIME         DATE                       NOT NULL,
  END_TIME           DATE                       NOT NULL,
  DRIVE_CANCELLED    DATE,
  ONLINE_SCHED_DATE  DATE,
  COLUMN_NAME        VARCHAR2(50 BYTE),
  OLD_VALUE          VARCHAR2(240 BYTE),
  NEW_VALUE          VARCHAR2(240 BYTE),
  AUDIT_KEY          NUMBER
)



Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/12/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2025785, TO_DATE('11/01/2006 08:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 14:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/28/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 178716);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/11/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2025419, TO_DATE('08/01/2014 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2014 19:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/15/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 
    NULL, 'open_to_public', 'N', 'Y', 178255);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/28/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026145, TO_DATE('02/01/2015 09:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('02/01/2015 13:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/06/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 179458);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/10/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026155, TO_DATE('10/01/2014 16:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('10/01/2014 19:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/30/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 179485);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/07/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026820, TO_DATE('12/01/2014 09:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/01/2014 13:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/12/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 180869);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/19/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2025804, TO_DATE('02/01/2011 08:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('02/01/2014 14:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/19/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 178735);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/07/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027260, TO_DATE('01/01/2015 09:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 13:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/06/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181782);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/27/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2025959, TO_DATE('01/01/2015 07:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 11:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/16/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'Y', 'N', 179249);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/06/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026940, TO_DATE('12/01/2014 10:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/01/2014 14:30:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/16/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181327);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/11/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026823, TO_DATE('12/01/2014 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/01/2014 19:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/16/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 180870);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/13/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027266, TO_DATE('01/01/2015 08:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/20/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181824);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/08/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2025358, TO_DATE('08/01/2014 08:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2014 12:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/20/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 178064);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/24/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2025761, TO_DATE('01/01/2011 12:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/01/2008 16:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/20/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 178692);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/28/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027277, TO_DATE('01/01/2015 07:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 12:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/09/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181882);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/23/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2025812, TO_DATE('01/01/2012 08:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('02/01/2011 14:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/21/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'Y', 'N', 178743);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/15/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026401, TO_DATE('11/01/2014 11:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('11/01/2014 14:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/22/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 180035);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/11/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027321, TO_DATE('01/01/2015 16:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 19:30:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/27/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 182064);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/21/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026349, TO_DATE('11/01/2014 08:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('11/01/2014 12:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/05/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 179851);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/25/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027285, TO_DATE('01/01/2015 11:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/05/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181909);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/26/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027286, TO_DATE('01/01/2015 11:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/05/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181910);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/07/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027267, TO_DATE('01/01/2015 09:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 13:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/01/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181825);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/01/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026157, TO_DATE('10/01/2014 08:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('10/01/2014 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/13/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 179502);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/24/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027394, TO_DATE('01/01/2015 12:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 16:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/23/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 182347);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/30/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027335, TO_DATE('01/01/2015 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 19:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/17/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 182162);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/25/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027346, TO_DATE('01/01/2015 10:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 14:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/16/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 182186);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/17/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027327, TO_DATE('01/01/2015 11:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 15:30:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('02/02/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 182082);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/07/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026149, TO_DATE('10/01/2014 09:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('10/01/2014 13:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('02/03/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 179462);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/28/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027300, TO_DATE('01/01/2015 06:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 11:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('02/02/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181964);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/14/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027537, TO_DATE('02/01/2015 09:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('02/01/2015 14:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('02/04/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 182588);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/21/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027392, TO_DATE('01/01/2015 08:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 12:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('02/04/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 182345);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/23/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027281, TO_DATE('01/01/2015 11:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('02/04/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181905);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/26/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027390, TO_DATE('01/01/2015 13:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 16:30:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('02/04/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 182343);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/27/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2025760, TO_DATE('01/01/2014 07:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2014 13:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    NULL, 'open_to_public', 'Y', 'N', 178691);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/30/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027284, TO_DATE('01/01/2015 16:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 19:30:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('02/04/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181908);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/23/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027514, TO_DATE('01/01/2015 11:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('02/01/2015 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('02/04/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 182529);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/23/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027514, TO_DATE('01/01/2015 11:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('02/01/2015 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('02/04/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'Y', 'N', 182529);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/17/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2025929, TO_DATE('01/01/2015 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 18:30:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/08/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 179024);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/08/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026417, TO_DATE('01/01/2015 10:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 14:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/16/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 180089);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/22/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026836, TO_DATE('12/01/2014 08:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/01/2014 12:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/27/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 180926);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/23/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027309, TO_DATE('01/01/2015 16:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 19:30:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/27/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 182022);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/25/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026834, TO_DATE('01/01/2015 13:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 16:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/07/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 180924);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/25/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026835, TO_DATE('01/01/2015 09:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 12:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/07/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 180925);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/10/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026828, TO_DATE('12/01/2014 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/01/2014 19:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/07/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 180902);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/05/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027301, TO_DATE('01/01/2015 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 19:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/30/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181965);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/22/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027241, TO_DATE('01/01/2015 10:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 14:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/30/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181723);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/01/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027280, TO_DATE('01/01/2015 08:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 13:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/19/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181904);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/13/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2025515, TO_DATE('12/01/2013 08:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/01/2013 13:30:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/26/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 178367);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/18/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026880, TO_DATE('12/01/2014 11:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/01/2014 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/28/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 180997);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/24/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027419, TO_DATE('01/01/2015 11:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/29/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 182391);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/01/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026819, TO_DATE('01/01/2015 07:40:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/01/2014 12:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/08/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 180868);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/25/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026802, TO_DATE('01/01/2015 09:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 12:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/16/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 180843);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/21/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027282, TO_DATE('01/01/2015 07:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 11:30:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/27/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181906);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/23/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026804, TO_DATE('12/01/2014 09:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/01/2014 11:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/22/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 180844);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/12/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026358, TO_DATE('11/01/2014 08:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('11/01/2014 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('11/11/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 179860);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/12/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026358, TO_DATE('11/01/2014 08:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('11/01/2014 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('11/11/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'Y', 'N', 179860);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/09/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2025777, TO_DATE('01/01/2013 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2013 19:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/12/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 178708);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/12/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026482, TO_DATE('11/01/2014 16:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('11/01/2014 19:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/15/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 180329);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/23/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027534, TO_DATE('02/01/2015 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('02/01/2015 19:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('02/02/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 182586);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/11/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027315, TO_DATE('01/01/2015 09:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 13:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('02/02/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 182046);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/12/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026454, TO_DATE('01/01/2015 13:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/01/2014 16:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    NULL, 'open_to_public', 'N', 'Y', 180170);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/26/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2025928, TO_DATE('01/01/2015 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 19:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/19/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 179023);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/04/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026350, TO_DATE('11/01/2014 15:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('11/01/2014 19:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    NULL, 'open_to_public', 'N', 'Y', 179852);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/21/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026329, TO_DATE('01/01/2015 08:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('11/01/2014 13:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('12/17/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 179786);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/28/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026810, TO_DATE('01/01/2015 08:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 12:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('12/04/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 180863);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/21/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027331, TO_DATE('01/01/2015 09:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 13:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    NULL, 'open_to_public', 'N', 'Y', 182104);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('03/15/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2027238, TO_DATE('12/01/2014 08:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/01/2014 12:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('12/29/2014 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181702);
Insert into TAB_NEW
   (DRIVE_DATE, DRIVE_ID, START_TIME, END_TIME, DRIVE_CANCELLED, 
    ONLINE_SCHED_DATE, COLUMN_NAME, OLD_VALUE, NEW_VALUE, AUDIT_KEY)
 Values
   (TO_DATE('02/25/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2026927, TO_DATE('01/01/2015 11:30:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2015 15:30:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
    TO_DATE('01/02/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'open_to_public', 'N', 'Y', 181264);
COMMIT;

Open in new window


Requirement

select * from tab_new
 where column_name in ('open_to_public')
   and trunc(drive_date) between trunc(sysdate+1) and trunc(sysdate+60)
   and new_value is not null

I want the list only then the old value and new value is different or changed from 'N' to 'Y' or from 'Y' to 'N'
0
Comment
Question by:anumoses
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
johnsone earned 500 total points
ID: 40591505
To me the query below should work:
SELECT * 
FROM   tab_new 
WHERE  column_name IN ( 'open_to_public' ) 
       AND drive_date >= Trunc(SYSDATE + 1) 
       AND drive_date < Trunc(SYSDATE + 61) 
       AND new_value IS NOT NULL 
       AND Nvl(old_value, new_value 
                          || 'a') != new_value; 

Open in new window

However, your sample data contains only rows where old and new value are different.  So, all rows of the sample data are returned.
0
 
LVL 6

Author Comment

by:anumoses
ID: 40591517
How can I add a clause showing if old_value = 'N' and new_value = 'Y'

Is it that simple like
and old_value = 'N' and new_value = 'Y' ?
0
 
LVL 35

Expert Comment

by:johnsone
ID: 40591555
You asked for:

old value and new value is different

If old is N and new is Y, then that is different correct?  So, you don't need an additional case for specific values.
0
 
LVL 6

Author Closing Comment

by:anumoses
ID: 40592061
thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious sideā€¦
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question