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

时间:2015-01-23 17:47:56

标签: postgresql

我有以下情况:

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行?

1 个答案:

答案 0 :(得分:1)

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;