I have 3 columns in my DB table as follows. 1. START_TIME 2. END_TIME 3. INDEX_NO
Sample records below
INDEX_NO END_TIME START_TIME
------------- ------------------------------- -------------------------------
I152 13-JAN-14 02.30.00.000000000 AM 13-JAN-14 12.10.00.000000000 AM
I151 13-JAN-14 05.30.00.000000000 AM 13-JAN-14 03.15.00.000000000 AM
I152 20-JAN-14 02.30.00.000000000 AM 20-JAN-14 12.10.00.000000000 AM
I151 20-JAN-14 05.30.00.000000000 AM 20-JAN-14 03.15.00.000000000 AM
From the above result set i need extract the MIN(START_TIME) and MAX(END_TIME) along with the INDEX_NO of the record with MIN(START_TIME)
To summarize the expected output is as follows.
INDEX_NO END_TIME START_TIME
------------- ------------------------------- -------------------------------
I152 20-JAN-14 05.30.00.000000000 AM 13-JAN-14 12.10.00.000000000 AM
Can anyone help me with a query of minimal cost to do the above extraction?
i am using oracle 11g.