简体   繁体   English

内容在PostgreSQL中是否具有小写字母

[英]content has lower-case or not in postgresql

How can we check In PostgreSQL or SQL: 我们如何在PostgreSQL或SQL中进行检查:

A string saved in database to lowercase OR uppercase? 保存在数据库中的字符串是小写还是大写?

For example, I have five records in my database table and I want to fetch only those records that have lowercase characters. 例如,我的数据库表中有5条记录,而我只想获取那些具有小写字符的记录。

Here is my content table and id's in primary key 这是我的内容表和ID在主键中

id    Content

 1     TEST
 2     Test
 3     TEst
 4     TESt
 5     TEST01

I need to fetch id 2,3,4 respectively which contains context value in lowercase. 我需要分别获取包含小写上下文值的id 2,3,4。

Add the following WHERE clause: 添加以下WHERE子句:

WHERE content <> upper(content)

That will only retrieve the rows that contain lower case characters. 那只会检索包含小写字符的行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM