Jump to content

Wow to use sql to check if there's any value is null


Patty_Tu

Recommended Posts

The only way is to do a null test on every column in the table.

SELECT * FROM table_name WHERE column1 IS NULL OR column2 IS NULL OR  column3 IS NULL OR column4 IS NULL

I can't think of any practical use case where I'd want to test for null in all columns.

Link to comment
Share on other sites

Unfortunately, there is no way to do that in standard SQL, but it really won't take longer than 5 minutes to write the query even if the table has 100 columns.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...