postgresql怎么查询不等于空的字段

2025年02月08日 postgresql Python51

在使用pgsql时,想要取到某些字段不为空或者为空的数据,可以用以下方法:

1、不为空

Select   *   From   table Where id<>''
Select   *   From   table Where id!=''

2、为空

Select * From table Where id=''

Select * From table Where IS NULL(id)

如果字段是类型是字符串,用 id=''可以;如果是int型则用 IS NULL。

推荐学习《Python视频教程》。

本文链接:http://so.lmcjl.com/news/22761/

展开阅读全文