27,579
社区成员
发帖
与我相关
我的任务
分享
create table #([unicode] varchar(10),[ascii] varchar(10))
declare @i int
set @i=1
while(@i<=128)
begin
insert into #
select char(@i),@i
set @i=@i+1
end
select * from #
declare @tb table (a int,b int,c varchar(50))
insert into @tb select 1,2,'12354/'
insert into @tb select 3,4,'54156%'
insert into @tb select 5,6,'87415426$'
insert into @tb select 7,8,'15646'
select a,b,
case when unicode(right(c,1)) not between 49 and 58 or unicode(right(c,1)) not between 66 and 91 or unicode(right(c,1)) not between 98 and 123
then left(c,len(c)-2)
else c end as c
from @tb