mssql sqlserver 查询数据表中“指定字段”的最后一个字符是中文或英文的方法


摘要:
下文讲述sqlserver中检索数据表中 字段里最后一个字符是中文或英文的方法,如下所示:
实验环境:sql server 2008 R2


  create table [maomao365.com](info nvarchar(88))
insert into [maomao365.com] values('sqlserver')
insert into [maomao365.com] values('maomao365')  
insert into [maomao365.com] values('SQL')  
insert into [maomao365.com] values(N'数据库')
go

--中文检测
select * from [maomao365.com] where right(info,1) between '吖' and '咗'
--英文检测
select * from [maomao365.com] where right(info,1) between 'A' and 'Z'

go
drop table [maomao365.com]
mssql_sqlserver_最后一个字符检测_9759

mssql_sqlserver_最后一个字符检测