22,209
社区成员
发帖
与我相关
我的任务
分享
create table tb (id varchar(50))
insert tb
select 'IV2008120810132557320090106111510364' union all
select 'IV2008120810132557320090106111721235' union all
select 'IV2008120810132557320090106132529315' union all
select 'IV2008120810132557320090107160523036' union all
select 'IV2008120810132557320090107160921036' union all
select 'IV2008120810132557320090107161030630' union all
select 'IV2008120810132557320090107161545661' union all
select 'IV2008120810132557320090108150828317' union all
select 'IV2008120810132557320090108151050645'
select substring(id,5,12)+'-'+ ltrim(datediff(mi,stuff(stuff(stuff(substring(id,5,12),11,0,':'),9,0,':'),7,0,' '),stuff(stuff(stuff(substring(id,22,12),11,0,':'),9,0,':'),7,0,' ')))
from tb
/*
-------------------------------------
081208101325-41822
081208101325-41824
081208101325-41952
081208101325-43552
081208101325-43556
081208101325-43557
081208101325-43562
081208101325-44935
081208101325-44937
(所影响的行数为 9 行)
*/