仅返回小写结果的 T-SQL 查询 [英] T-SQL Query That Returns lower case Results Only

查看:41
本文介绍了仅返回小写结果的 T-SQL 查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为KEYWORDS"的表,其中有一列名为ENTRY"的 VARCHAR(10).是否可以仅从该表中检索小写条目?

I have a table named "KEYWORDS" with a column named "ENTRY" of VARCHAR(10). Would it be possible to retrieve only the lower-case entries from that table?

例如,表格可能如下所示:

For example, the table might look like this:

ENTRY
===========
SearchString
Searchstring
searchstring
SEARCHSTRING

而且我希望能够运行类似于以下内容的查询:

And I would like to be able to run a query that looks similar to:

SELECT ENTRY FROM KEYWORDS WHERE ENTRY <condition to retun only the lowercase entry>

上面的结果将是:searchstring

如果可以做到,那么接下来我希望能够仅检索 ProperCase 条目.这是 GoDaddy.com 托管上的托管 SQL Server 2005 数据库,所以我不太了解它的配置方式.我没有权限运行 EXEC sp_help DatabaseName

And if that can be done, then I would like to be able to retrieve only the ProperCase entries next. This is a hosted SQL Server 2005 database on GoDaddy.com hosting so I dont know much about how its configured. I do not have permission to run EXEC sp_help DatabaseName

我会参考这个页面:http://blog.sqlauthority.com/2007/04/30/case-sensitive-sql-query-search/读起来很有趣,因为它与我正在寻找的内容相似,但不同之处在于运行查询的人知道他们在寻找什么.

I will reference this page: http://blog.sqlauthority.com/2007/04/30/case-sensitive-sql-query-search/ which was interesting to read because its similar to what I am looking for but different in that the person running the query knows what they are looking for.

我想要所有小写的条目.

I would like ALL entries that are lowercase.

推荐答案

试试这个:

where Entry COLLATE Latin1_General_CS_AS = Lower(entry)

这篇关于仅返回小写结果的 T-SQL 查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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