Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
postgresql-不等于的查询不起作用_Postgresql - Fatal编程技术网

postgresql-不等于的查询不起作用

postgresql-不等于的查询不起作用,postgresql,Postgresql,这是一个愚蠢的问题,但我仍在尝试用postgresql编写一个不等于where子句。文档显示符号为or!=两者都始终返回0个结果 where位于整数字段上 select userid from users where usertype <> 2; select userid from users where usertype != 2; 注意:下面的解决方法是一种解决方法,并返回结果 select userid from users where usertype < 2 or

这是一个愚蠢的问题,但我仍在尝试用postgresql编写一个不等于where子句。文档显示符号为or!=两者都始终返回0个结果 where位于整数字段上

select userid from users where usertype <> 2;
select userid from users where usertype != 2;
注意:下面的解决方法是一种解决方法,并返回结果

select userid from users where usertype < 2 or usertype > 2;

我只是想知道是否有人遇到同样的问题?

您能将您的查询复制并粘贴到这里吗?也许您正在比较空值?在第3行中,将您的查询发布在这里。这意味着除了usertype=2之外,没有其他记录可以提供ddl create table。。。;插入语句,这样我们就知道了数据的结构和插入的数据是什么?
select userid from users where usertype < 2 or usertype > 2;