SQL 区分大小写的字符串比较 [英] SQL Case Sensitive String Compare

查看:35
本文介绍了SQL 区分大小写的字符串比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您如何比较字符串,以便仅当每个字符串的情况也相等时比较才为真.例如:

How do you compare strings so that the comparison is true only if the cases of each of the strings are equal as well. For example:

Select * from a_table where attribute = 'k'

...将返回具有K"属性的行.我不想要这种行为.

...will return a row with an attribute of 'K'. I do not want this behaviour.

推荐答案

Select * from a_table where attribute = 'k' COLLATE Latin1_General_CS_AS 

成功了.

这篇关于SQL 区分大小写的字符串比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆