SELECT
B.Recid,
TO_CHAR (B.First_Time, 'DD-MON-YY HH: MI: SS') Start_time,
A.Recid,
TO_CHAR (A.First_Time, 'DD-MON-YY HH: MI: SS') End_Time,
Round ((A.First_Time-B.First_Time) * 24) * 60, 2) Minutes
From v $ log_history a, v $ log_history B
WHERE A.Recid = B.Recid 1
Order by a.first_time ASC