------解决方案-------------------- create table t (id int identity(1,1),mobile nvarchar(max))
insert into t values ('13312345678 13512345671 13812345675'),
('13316012347 13101234568 13812345687')
,('13312345678 13812345675 18912345678 13312345679 13212345678 '),
('13012345679')
select * from t
select substring(mobile,1,11) as mobile1,
case substring(mobile,13,11) when '' then null else substring(mobile,13,11) end as mobile2,
case substring(mobile,25,11) when '' then null else substring(mobile,25,11) end as mobile3,
case substring(mobile,37,11) when '' then null else substring(mobile,37,11) end as mobile4,
case substring(mobile,49,11) when '' then null else substring(mobile,49,11) end as mobile5,
case substring(mobile,61,11) when '' then null else substring(mobile,61,11) end as mobile6