我有一个 SQL 查询,它计算与 IP 语音的对话总数。
SELECT COUNT(*) AS 'Aantal gesprekken'
,FromUri AS 'Medewerker'
,SUM(DATEDIFF(hour,InviteTime,EndTime)) AS 'Uren'
,SUM(DATEDIFF(minute,InviteTime,EndTime)) AS 'Minuten'
,SUM(DATEDIFF(second,InviteTime,EndTime)) AS 'Secondes'
FROM [LcsCDR].[dbo].[SessionDetailsView]
WHERE FromUri LIKE '%robert%'
AND (CAST([InviteTime] AS date)) BETWEEN '2012-12-27' AND '2013-01-28'
AND MediaTypes = '16'
GROUP BY FromUri
SQL Server 2012 给出了这个结果:数字、员工、小时、分钟和秒。
302 robert 11 518 31316
但我需要得到这个结果:28 小时 19 分 56 秒。我计算了调节器 / 60 的方式,但是我怎样才能在 SQL 中做到这一点才能得到准确的结果?!
转发,非常感谢!