Page 1 of 1

how to eliminate records with null values in any of the cols

PostPosted: Mon Sep 14, 2009 1:16 pm
by dvramanad
Hi friends.My requirement is like this
I want to eliminate records which contain null in any of the coloumn or in all coloumns.

empno empname empaddress1 empaddress2 salary designation
------- ----------- -------------- --------------- ------- -------------
111 name1 usa 1000 se
222 name2 ind bangalore 2000 sse
333 name3 Canada 2200 tl
444 name4 1100 pm
555 name ind 1000 sse

when i query on the above table.I should get only the second record which contain values under all coloumns...
Pls help.

Re: how to eliminate records with null values in any of the cols

PostPosted: Mon Sep 14, 2009 11:07 pm
by dick scherrer
Hello,

Suggest you become familiar/comfortable with the "Code" tag to improve readability and preserve alignment (Use Preview until you are satisfied with the appearance of the post, then Submit).

Are the columns defined to support NULL or are the values simply not entered?

Re: how to eliminate records with null values in any of the cols

PostPosted: Mon Sep 21, 2009 11:23 am
by momi sabag
try
select *
from mytable
where empno is not null
and empname is not null
and empaddress1 is not null
and empaddress2 is not null
and salary is not null
and designation is not null