sql - PostgreSQL - 不为 null 且不为空字符串的空值

标签 sql postgresql notnull

我在 PostgreSQL 表上运行了此查询:

select * wkt from table  where column <>'' and  column is not null

..意外地收到了几行,该列中没有可见的值。为什么是这样?这些行的该列中是否存在一些“隐藏”值,或者损坏的表,或者其他什么?

最佳答案

t=# select ascii(chr(9));
 ascii
-------
     9
(1 row)

因此

select ascii(column) from table  where column <>'' and  column is not null

应该给出想法

https://www.postgresql.org/docs/current/static/functions-string.html

ASCII code of the first character of the argument. For UTF8 returns the Unicode code point of the character. For other multibyte encodings, the argument must be an ASCII character.

关于sql - PostgreSQL - 不为 null 且不为空字符串的空值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48447681/

相关文章:

php - 我如何在 PHP 中使用 MySQL NOT NULL?

sql - BigQuery : Use COUNT as LIMIT

postgresql - 使用规则插入副表自增序列

postgresql9.1 突然无法连接到服务器 : No route to host

postgresql - 替换文本字段中字符串的所有实例

php - 使用空值格式化 php echo

mysql - 创建MySQL表列什么时候写NOT NULL

c# - 如何在 SQL Server 2008 中的表的 2 列中设置身份规范 YES

sql - count(*) 与 count(column-name) - 哪个更正确?

c# - 如何在离线模式下提供唯一 ID?