【SQL开源代码栏目提醒】:网学会员,鉴于大家对SQL开源代码十分关注,论文会员在此为大家搜集整理了“096.sql”一文,供大家参考学习!
declare @i nvarchar(50);set @i='';
declare @j nvarchar(50);set @j='';
select @i=@i+b.c
from(
select substring(a.n,iter.pos,1) as c
from (select 'asdf1*h456' as n)a ,
(select id as pos from tb_num04)iter
where iter.pos<=len(a.n))b
where ascii(b.c) between 48 and 57;
select @j=@j+b.c
from(
select substring(a.n,iter.pos,1) as c
from (select 'asdf1*h456' as n)a ,
(select id as pos from tb_num04)iter
where iter.pos<=len(a.n))b
where ascii(b.c) not between 48 and 57;
select @i as 数字,@j as 字符