2013-05-08 96 views
0

我在Oracle中的一些数据现在我想如下 - 我要排除这些行来过滤这些数据,所有COL1,COL2,COL3,COL4是 'N'过滤数据由四列

enter image description here

我尝试以下,这样我可以得到列所有COL1,COL2,COL3,COL4不是 'N'

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

但它不工作。 我需要在这里包括什么额外条件才能获得理想的结果。

回答

1

尝试像

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’) 
+0

是其工作。谢谢 !!!!混淆我怎么没有意识到使用OR。 – 2013-05-08 12:56:45