BEGIN SELECT ShiftDate,ProcessNameId,ProcessName,EmployeesId,UserName,EmployeesName,ShiftName,CAST(SUM(CasingLength) as decimal(18, 0)) as [Output],CAST(ROUND(SUM(CAST(DATEDIFF(ss,StartDate,CreateDate) AS decimal(18, 0))/3600),2) AS decimal(18, 2)) AS TakeTime,convert(decimal(18,2),ROUND(SUM(Timesheet),2)) AS Timesheet, (case when SUM(DATEDIFF(ss,StartDate,CreateDate))!=0 then convert(decimal(18,2),(ROUND(SUM(Timesheet)/SUM(DATEDIFF(ss,StartDate,CreateDate)/3600.0),2))) else 0 end) as ReachRate, (case when (max(IsQuoteNone) =0) then '否' else '是' end) as IsQuoteNone from #Pipe group by ShiftDate,ProcessNameId,ProcessName,EmployeesId,UserName,EmployeesName,ShiftName ORDER BY ShiftDate ASC,ProcessName asc ,ShiftName ASC,EmployeesName ASC END 注释 以上代码
时间: 2023-05-18 13:04:23 浏览: 86
这是一条SQL查询语句,目的是从数据库中获取一些数据。具体来说,它会返回以下列:ShiftDate、ProcessNameId、ProcessName、EmployeesId、UserName、EmployeesName、ShiftName、Output、TakeTime、Timesheet、ReachRate和IsQuoteNone。这些列中包含了一些关于工作班次、员工、工作时间、产量等方面的信息。其中,ReachRate表示达成率,IsQuoteNone表示是否有报价。
阅读全文