da el mismo resultado que el que te puse anteriormente, ahora ordenarlo??? con un rder by no?? o con un
Código SQL:
Ver originalSELECT * FROM(
SELECT CAST(SUM(DATEDIFF(SECOND,0,campo2))/3600 AS VARCHAR(12)) +
':' + RIGHT('0' + CAST(SUM(DATEDIFF(SECOND,0,campo2))/60%60 AS VARCHAR(2)),2) +
':' + RIGHT('0' + CAST(SUM(DATEDIFF(SECOND,0,campo2))%60 AS VARCHAR(2)),2)TOTAL_HORAS
FROM #temp
) AS t1 ORDER BY CONVERT(TIME,total_horas) DESC