日期:2014-05-18  浏览次数:20527 次

一个关于time数据类型的问题
我想用time数据类型做一个数据库,其中要用到减法运算,但是发现time不支持减法、、希望有人能给我一个办法,让两个时间能够相减,例如13:13:13-12:12:12=01:01:01
数据库是SQL server 2008

------解决方案--------------------
探讨

create table tbl(
id int identity(1,1),
time1 time not null,
time2 time not null,
time3 time
)
insert tbl
select '13:13:13','12:12:12','' union all
select '12:36:45','12:12:12','' union all
……

------解决方案--------------------
探讨

参考这个方法自己弄弄