Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: SQL
Expertise: Beginner
Jan 5, 2010

Use Comparison Operators in SQL to Remove/Return Columns with Null Values

When you use the comparison operators in SQL with the Where clause, you can remove the columns with null values. If you need the values with null too, then you need to use the appropriate ISNull function as follows:
where IsNull(columnname, value) not like 'comparisonValue'
Replace columnname with the correct column name and value with something like 'comparisonValue' & 'extraText'.

The extraText is just to ensure that you don't end up fetching a record that exactly matches the replacement value.

Srinath MS
Thanks for your registration, follow us on our social networks to keep up-to-date