How to find the total hours between two dates row wise. I have a table named as activity which contains five columns as id,date,time,entry_type (0 Means out , 1 Means In) and eid.
In time column we have both the Intime and Outtime of the employee respectively. how to display both the Intime and Outtime separately of the respective employees.
Activity Table Strucuture
id Date time entry_type eid
1 2017-04-14 01:31:47 1 2
2 2017-04-14 02:31:47 0 2
3 2017-04-14 02:35:47 1 2
4 2017-04-14 02:55:60 0 2
5 2017-04-14 03:00:00 1 2
I need the output as below:
id Date In time Out Time Total Hours
1 2017-04-14 01:31:47 02:31:47 ?
2 2017-04-14 02:35:47 02:55:60 ?
3 2017-04-14 03:00:00