Home » Developer & Programmer » Reports & Discoverer » Select NOT IN not bringing nulls
Select NOT IN not bringing nulls [message #88247] Tue, 28 May 2002 05:43 Go to next message
Vinod Pujar
Messages: 1
Registered: May 2002
Junior Member
If there is a column containing null's and not-nulls and i have a query that says select * from table1 where col not in ('A', 'B'), it does not bring the rows containing null values for col, how do i do it?

Vinod
Re: Select NOT IN not bringing nulls [message #88250 is a reply to message #88247] Tue, 28 May 2002 20:57 Go to previous messageGo to next message
rama krishna
Messages: 97
Registered: December 2001
Member
hii,
u cannot compare null values with any thing so if u say a column not in something it will not compare it with nulls existing....

for that u need to use nvl function to get the desired output

cheers
ram
Re: Select NOT IN not bringing nulls [message #88731 is a reply to message #88247] Thu, 27 February 2003 03:46 Go to previous message
priya
Messages: 108
Registered: February 2000
Senior Member
use query :

select * from table1
where col not in('A','B') or col is null;

this will work ....
Previous Topic: store procedure
Next Topic: add values from 3 cloumns into a new column
Goto Forum:
  


Current Time: Thu Mar 28 11:17:30 CDT 2024