Skip to content
Advertisement

How can I filter out the rows which contain a particular column with null or empty data in SQL?

In SQL, How we make a check to filter all row which contain a column data is null or empty ?
For examile

Select Name,Age from MEMBERS

We need a check Name should not equal to null or empty.

Advertisement

Answer

This will work in all sane databases (wink, wink) and will return the rows for which name is not null nor empty

select name,age from members where name is not null and name <> ''
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement