求助:排序规则与LIKE的一个实例
--数据库排序规则为Chinese_PRC_CI_AS
select name,collation_name from sys.databases
GO
if OBJECT_ID('test') is not null
drop table test
GO
create table test
(
a varchar(40)
)
GO
insert into test
select '123A90' union all
select '123a90' union all
select '123B90' union all
select '123C90' union all
select '123c90'
select * from test
select *
from test
where a like '%[ABC]%'
collate Chinese_PRC_CS_AS
a
-------------
123A90
123B90
123C90
select *
from test
where a like '%[A-C]%'
collate Chinese_PRC_CS_AS
a
------------------
123A90
123B90
123C90
123c90