List:General Discussion« Previous MessageNext Message »
From:Yasir Assam Date:December 30 2005 6:53am
Subject:Checking for all columns null
View as plain text  
Is there a simple way of checking whether all the columns in a SELECT 
are NULL? I know I can do the following:

SELECT c1, c2, c3 FROM t WHERE COALESCE(c1, c2, c3) IS NOT NULL

but this relies on specifying every column I've selected (which in my 
actual code is a lot of columns that may change during development).

I was hoping there was a convenience syntax for checking whether all the 
selected columns are NULL, without having to specify each column, e.g. 
in pseudocode

SELECT c1, c2, c3 FROM t WHERE COALESCE(All_Selected_Columns) IS NOT NULL

Is there such a thing?

Thanks,
Yasir



Thread
Checking for all columns nullYasir Assam30 Dec