postgresql 中的文本过滤器(如何查找字段中没有数据的行)

text filter in postgresql (how to find rows without data in a field)

我有以下情况:

Select count(*) from cliente

给出 1964

Select count(*) from cliente where concli between 'A' and 'ZZ'

给出 1939

Select count(*) from cliente where concli not between 'A' and 'ZZ'

给出 0

如何获取其他 25 行?

not between 'A' and 'ZZ'concli 有值的行上进行测试,即 concli 不是 null。缺少的 25 行肯定是 null 个值。所以你的第二个查询应该是:

Select count(*) from cliente where concli not between 'A' and 'ZZ' or concli is null;