Home » SQL & PL/SQL » SQL & PL/SQL » filtering columns with NULL values (Oracle10g)
filtering columns with NULL values [message #313223] Fri, 11 April 2008 02:08 Go to next message
hidnana
Messages: 87
Registered: November 2007
Location: chennai
Member
select c1, c2 from t1 

returns 

c1     c2
---   ---
       -1
      39
       7
Y     11
Y     23
N     15
Y     18
N     10

but when the following SQL is executed

select c1, c2 from t1 
where c1 <> 'Y'
and c1 <> 'N'

no rows returned

again when I try this, 

select c1, c2 from t1 
where c1 not in ('Y', 'N')

no rows returned


but the following SQL 

select c1, c2 from t1 
where c1 is null 

returns 

c1     c2
---   ---
       -1
      39
       7


What could be the reason 

Re: filtering columns with NULL values [message #313224 is a reply to message #313223] Fri, 11 April 2008 02:16 Go to previous message
MarcS
Messages: 312
Registered: March 2007
Location: Antwerp
Senior Member
Because it's designed that way: regarding NULL
Previous Topic: Selecting from a stored proc
Next Topic: dynamic list of dates
Goto Forum:
  


Current Time: Sun Dec 11 02:16:36 CST 2016

Total time taken to generate the page: 0.10022 seconds