SELECT TOP (10)
CONVERT(varchar(10), DATEDIFF(SECOND, StartDate, EndDate) % 86400 / 3600) AS Hour
FROM dbo.t_detail
WHERE (Number = '5111006034')
ORDER BY Hour DESC
Tag : PHP, Ms SQL Server 2005, Ms SQL Server 2008, Ms SQL Server 2012, Ms SQL Server 2014, Ms SQL Server 2016