Hussain Ahmed

Hussain Ahmed

  • NA
  • 61
  • 1.3k

Calculate total time in oracle sql

Jan 2 2017 6:33 AM
Select Op.Operator_Name,Op.Emp_Code,
(Cast (Oplogin1.Signout_Time As Timestamp) - Cast (Oplogin1.Signin_Time As Timestamp)) As Licensed_Time,
(Cast (Oplogin2.Signout_Time As Timestamp) - Cast (Oplogin2.Signin_Time As Timestamp)) As Trainee_Time,
(Cast (Oplogin3.Signout_Time As Timestamp) - Cast (Oplogin3.Signin_Time As Timestamp)) As Superviser_Time
From Tblsapt_Operator Op
Left Join Tblsapt_Loginst_Operator1 Oplogin1 On (Op.Emp_Code = Oplogin1.Operator)
Left Join Tblsapt_Loginst_Operator2 Oplogin2 On (Op.Emp_Code = Oplogin2.Operator)
Left Join Tblsapt_Loginst_Operator3 Oplogin3 On (Op.Emp_Code = Oplogin3.Operator)
 
 
 
i am using the above query .using sql oracle i want to total "TRAINEE_TIME" with respect to EMP_CODE as mentioned in attached image. please help. 

Answers (2)