반응형
■ 시분초를 초로 변경
select datediff(second, '00:00:00', '00:05:05') "ss" ss ----------- 305 |
■ '초'를 '시분초'로 변환
DECLARE @Seconds INT = 305; SELECT @Seconds AS [Total_Seconds], @Seconds / 3600 AS [Hours], (@Seconds % 3600) / 60 AS [Minutes], @Seconds % 60 AS [Seconds]; Total_Seconds Hours Minutes Seconds ------------- ----------- ----------- ----------- 305 0 5 5 |
반응형