ALOK Verma, January 09, 2020 - 12:50 pm UTC
Dear Sir,
Interviewer ask me this question, How to solve this problem through sql ?
TASKID | EMPLOYEECODE| SLOT_ACTION | date
1 A S 08/jan/2020 09:30:32 am
1 A p 08/jan/2020 02:10:20 pm
1 A S 09/jan/2020 09:50:50 am
1 A P 09/jan/2020 12/50:58 pm
1 A S 10/jan/2020 09:30:32 am
1 A P 10/jan/2020 12/50:58 pm
1 A S 11/jan/2020 09:30:32 am
1 A p 11/jan/2020 02:10:20 pm
1 A S 12/jan/2020 09:50:50 am
1 A P 12/jan/2020 12/50:58 pm
1 A S 13/jan/2020 09:30:32 am
1 A P 13/jan/2020 12/50:58 pm
1 A S 14/jan/2020 09:30:32 am
1 A p 14/jan/2020 02:10:20 pm
1 A S 15/jan/2020 09:50:50 am
1 A P 15/jan/2020 12/50:58 pm
1 A S 16/jan/2020 09:30:32 am
1 A P 16/jan/2020 12/50:58 pm
1 A S 17/jan/2020 09:30:32 am
1 A p 17/jan/2020 02:10:20 pm
1 A S 18/jan/2020 09:50:50 am
1 A P 18/jan/2020 12/50:58 pm
1 A S 19/jan/2020 09:30:32 am
1 A P 19/jan/2020 12/50:58 pm
. . . .
. . . .
like that 100 records there
2nd last and last record is
1 A S 10/feb/2020 09:30:58 am
1 A E 10/feb/2020 05:20:25 pm
they want calculate time.
they ask how much time taken to complete takid 1 for employee A?
Where
S - Start work
P - Pause work
E - End or completed work.
1 - Taskid
A - EMPLOYEECODE
January 09, 2020 - 1:20 pm UTC
You'll need to sum up the time between each (S,P) pair and the final S + E...
...but what's this got to do with the original question?
Excellent and fast assistance
Renee Bell, January 10, 2020 - 1:52 am UTC
Thank you very much for your response to my original question. It helped greatly. By the way, I have no idea why the other person asked that question that has no correlation to my question.
January 10, 2020 - 3:44 am UTC
Welcome to the world of AskTOM :-) We have no idea either.