I want to display the data in table 1 as in the form of table 2 in oracle.
Table 1.
Table 2 (Required).
I want to display the data in table 1 as in the form of table 2 in oracle.
Table 1.
Table 2 (Required).
It should be something like this:
SELECT T1.Sno
,T1.Name
,TO_CHAR(TRUNC(TO_DATE(T2.AttendanceTime, 'MM/DD/YYYY HH24:MI') - TO_DATE(T1.AttendanceTime, 'MM/DD/YYYY HH24:MI')), 'HH24:MI')
FROM my_table T1
INNER JOIN my_table T2
ON T1.Sno= T2.Sno-1
You just need to join the table twice.