Link to home
Start Free TrialLog in
Avatar of anushahanna
anushahannaFlag for United States of America

asked on

working with NULL values

what is the reason that the select statement does not bring back valid records. seems like the NULL can kill the query from bringing back good results..
-----------------------------------

create table one (first tinyint)
insert into one select 1 union select 2 union select 3
create table two (second tinyint)
insert into two select 1 union select NULL

select first from one where first not in (select second from two) -- does not work

drop table one
drop table two
ASKER CERTIFIED SOLUTION
Avatar of cyberkiwi
cyberkiwi
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of anushahanna

ASKER

phew.. will be careful with that one.. thanks for the example to make it easy..

really appreciate it..