Count of non null columns in a row
-
Hi, Can any body help me in writing a query to retrieve the count of non null columns in a particular row. For eg: I have 30 columns in a table and I enter values to only 5 columns. when I run the query I should get the output as 5 columns have non null values. If it is not possible then is it possible to read values of different columns of a single row into a single variable. Please help me out. ABC
-
Hi, Can any body help me in writing a query to retrieve the count of non null columns in a particular row. For eg: I have 30 columns in a table and I enter values to only 5 columns. when I run the query I should get the output as 5 columns have non null values. If it is not possible then is it possible to read values of different columns of a single row into a single variable. Please help me out. ABC
AFAIK, the only way of doing this would be to loop through the columns and count the number of fields with a NULL value. You may want to consider whether your database design is optimal for the type of work you are doing.
Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
-
Hi, Can any body help me in writing a query to retrieve the count of non null columns in a particular row. For eg: I have 30 columns in a table and I enter values to only 5 columns. when I run the query I should get the output as 5 columns have non null values. If it is not possible then is it possible to read values of different columns of a single row into a single variable. Please help me out. ABC