sql选择列不包含数字的位置
我需要一个sql命令来选择所有不包含特定数字的行 我所拥有的:sql选择列不包含数字的位置,sql,postgresql,select,Sql,Postgresql,Select,我需要一个sql命令来选择所有不包含特定数字的行 我所拥有的: Select * from table Where (col1 != 1 or col2 != 1 or col3 != 1) 问题是,这不会选择任何列为空的行。 所有3列都是整数类型。使用不同于而不是!=对于可为空的列: select * from my_table where ( col1 is distinct from 1 or col2 is distinct from 1
Select * from table
Where (col1 != 1 or col2 != 1 or col3 != 1)
问题是,这不会选择任何列为空的行。
所有3列都是整数类型。使用不同于而不是!=对于可为空的列:
select *
from my_table
where (
col1 is distinct from 1
or col2 is distinct from 1
or col3 is distinct from 1)
Tht仍然不会选择至少有1个空列的任何行。Oops。很抱歉你说空就是空。