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