create table CAR(cno int identity(1,1), cname varchar(20)) insert into CAR(cname) values('honda city') insert into CAR(cname) values('accent') insert into CAR(cname) values('ford fiesta') insert into CAR(cname) values('honda civic') insert into CAR(cname) values('Scorpio') insert into CAR(cname) values(null)
in the above table 6th record has a null field
SELECT * from car where cname in ( select cname from car where cname not like 'honda%')
when i type this query, why im not getting null record
and
when i type following query why im getting all the records
SELECT * from car where exists ( select cname from car where cname like 'honda%')