日期:2014-05-16 浏览次数:20524 次
create table wy
(x varchar(10),y varchar(10))
insert into wy(x)
select '7:30' union all
select '7:20'
update wy
set y=substring(x,1,charindex(':',x,1)-1)+'.'
+rtrim(cast(substring(x,charindex(':',x,1)+1,10) as int)/6)
select * from wy
/*
x y
---------- ----------
7:30 7.5
7:20 7.3
(2 row(s) affected)
*/