SQL查:询结果区分大小写

时间:2021-08-24 00:45:49

在MS SQL2005中的方法:

1)select * from user where name collate Chinese_PRC_CS_AS like 'A$%B%' escape '$';

或者

select * from user where name like 'A$%B%' escape '$' collate Chinese_PRC_CS_AS;

collate Chinese_PRC_CS_AS放在like前后都可以。

2)select * from user where name collate Chinese_PRC_CS_AS like 'A[%]B%';

或者

select * from user where name like 'A[%]B%' collate Chinese_PRC_CS_AS;

 

SELECT*
  FROM [Tts_API] where [A_Key] collate Chinese_PRC_CS_AS='Nlu33z4hrGixkNJ6KCvdSpN0fBjpeg09'