方案一: 更靈活,可以繼續具體下去。
create table #tt(cc varchar(20))
insert into #tt values('04:10')
insert into #tt values('06:10')
insert into #tt values('21:50')
SELECT LTRIM(dd/3600)+':'+RIGHT(100+dd%3600/60,2)+':'+RIGHT(100+dd%60,2) newcol FROM (SELECT SUM(DATEDIFF(ss,0,cc)) AS dd FROM #tt ) t
drop table #tt
方案二:
可随意轉載,歡迎署名!