Select 按四列筛选数据

Select 按四列筛选数据,select,oracle10g,filtering,Select,Oracle10g,Filtering,我在ORACLE中有以下格式的数据- 现在我想按如下方式过滤这些数据- 我想排除所有col1、col2、col3、col4都是“N”的行 我尝试了以下操作,以便可以得到所有col1、col2、col3、col4都不是“N”的列 Select * from Table1 Where (col1 != ‘N’ and col2 != ‘N’ and col3 != ‘N’ and col4 != ‘N’) 但它不起作用。 为了得到想要的结果,我需要在这里包括什么额外的条件。试试类似的方法 Se

我在ORACLE中有以下格式的数据-

现在我想按如下方式过滤这些数据- 我想排除所有col1、col2、col3、col4都是“N”的行

我尝试了以下操作,以便可以得到所有col1、col2、col3、col4都不是“N”的列

Select * from Table1
Where (col1 != ‘N’ and col2 != ‘N’ and col3 != ‘N’ and col4 != ‘N’)
但它不起作用。 为了得到想要的结果,我需要在这里包括什么额外的条件。

试试类似的方法

Select * from Table1
Where not (col1 = ‘N’ and col2 = ‘N’ and col3 = ‘N’ and col4 = ‘N’)

Select * from Table1
Where  (col1 != ‘N’ or col2 != ‘N’ or col3 != ‘N’ or col4 != ‘N’)