SQL查询区分大小写方法

SQL查询区分大小写方法

在SQL SERVER 中, 默认   select * from table where column1 = ' xx ' 不区分大小写
collate 选择排序 , 可用在查询区分大小写上,例:
select * from table where column1 collate Chinese_PRC_CS_AS= 'xx'
select * from table where column1 collate Chinese_PRC_CS_AS like 'a%'

CI    不区分大小写,CS  区分大小写。
AI    不区分重音,AS    区分重音。  
Omitted      不区分大小写,WS   区分大小写。

 

 

group by 区分大小写:
select (filed collate Chinese_PRC_CS_AI) as filed from table
group by (filed collate Chinese_PRC_CS_AI)  

 

 

摘自:https://blog.csdn.net/y1535623813/article/details/88656550

posted @ 2020-08-20 10:39  郑延杰  阅读(2732)  评论(0编辑  收藏  举报