Please help me as I need solution for the below given table.
My query is based on id and I have to do mens group by id.
The scenerio is that when status is running then it shows sum(starttime-stoptime); when status is stop then it gives sum(stoptime-starttime); when status is extend then it gives sum (starttime-stoptime); when status is terminted then there is no calculation and status is running then it gives sum(hourseuse-houreleft),when sttatus is stop then,sum(hourseuse-hoursrleft),when status is extend then,sum(hourseused-hourseleft),when status terminated then no calculation again.
And I also wanted to tell you guys that my starttime value is timestamp value and stoptime value is timestampvalue and hours used and hourleft is in hoursevalue.
So, after going thorugh the above scenerio if any of you guys know the solution then please try to revert me.
Thank You in Advance!