美文网首页
SQL查询区分大小写方法

SQL查询区分大小写方法

作者: 大龙10 | 来源:发表于2023-08-14 11:35 被阅读0次

1、SQL查询区分大小写方法

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

select * from table where column1 collate Chinese_PRC_CS_AS= 'aa'
select * from table where column1 collate Chinese_PRC_CS_AS like 'a%'

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

2、Group by 区分大小写:

select (filed collate Chinese_PRC_CS_AI) as filed from table
group by (filed collate Chinese_PRC_CS_AI)

相关文章

网友评论

      本文标题:SQL查询区分大小写方法

      本文链接:https://www.haomeiwen.com/subject/atltmdtx.html