Hi,
I need to prepare a output based on the below table:
<tbody>
</tbody>
Basically, I need the Time Difference from the 1st Type-0 and 1st Type-1 for the specific User.
And then if the user has multiple Type-1s, another record should be there the Time Stamp of Type-0 should be next one to the earlier Type-1 TimeStamp.
Below is the out of above table:
<tbody>
</tbody>
Thanks in advance.
I need to prepare a output based on the below table:
USER_ID | Type | Time Stamp |
User_1 | 0 | Dec-12-2018 19:53 |
User_1 | 0 | Dec-12-2018 19:53 |
User_1 | 0 | Dec-12-2018 19:57 |
User_1 | 0 | Dec-19-2018 18:30 |
User_1 | 0 | Dec-19-2018 18:31 |
User_1 | 0 | Dec-19-2018 18:32 |
User_1 | 0 | Dec-19-2018 18:33 |
User_1 | 1 | Dec-19-2018 18:35 |
User_2 | 0 | Dec-12-2018 17:36 |
User_2 | 0 | Dec-12-2018 17:37 |
User_2 | 0 | Dec-12-2018 19:12 |
User_2 | 1 | Dec-12-2018 19:15 |
User_3 | 0 | Dec-13-2018 0:47 |
User_3 | 0 | Dec-13-2018 0:47 |
User_3 | 0 | Dec-13-2018 0:48 |
User_3 | 0 | Dec-18-2018 2:22 |
User_3 | 0 | Dec-15-2018 14:01 |
User_3 | 0 | Dec-15-2018 14:01 |
User_3 | 0 | Dec-15-2018 14:01 |
User_3 | 0 | Dec-15-2018 14:02 |
User_3 | 0 | Dec-31-2018 0:55 |
User_3 | 0 | Dec-31-2018 0:55 |
User_3 | 1 | Dec-31-2018 0:55 |
User_3 | 0 | Dec-31-2018 0:59 |
User_3 | 1 | Dec-31-2018 2:30 |
<tbody>
</tbody>
Basically, I need the Time Difference from the 1st Type-0 and 1st Type-1 for the specific User.
And then if the user has multiple Type-1s, another record should be there the Time Stamp of Type-0 should be next one to the earlier Type-1 TimeStamp.
Below is the out of above table:
UserID | Time Stamp of Type 0 | Time Stamp of Type 1 | Time Difference |
User_1 | Dec-12-2018 19:53 | Dec-19-2018 18:35 | 6 days 22 hrs 41 mins |
User_2 | Dec-12-2018 17:36 | Dec-12-2018 19:15 | 0 days 1 hrs 38 mins |
User_3 | Dec-13-2018 0:47 | Dec-31-2018 0:55 | 18 days 0 hrs 7 mins |
User_3 | Dec-31-2018 2:59 | Dec-31-2018 8:30 | 0 days 5 hrs 31 mins |
<tbody>
</tbody>
Thanks in advance.