i have table T!.

A B C D
NULL 1 2 3
4 NULL 5 6
7 8 NULL 9
10 11 12 NULL.


I WANT COUNT OF NULL VALUES IN TABLE. WRITE A QUERY.

Answer Posted / chiranjib

SELECT SUM( CASE WHEN A IS NULL THEN 1
ELSE
CASE WHEN B IS NULL THEN 1
ELSE
CASE WHEN C IS NULL THEN 1
ELSE
CASE WHEN D IS NULL THEN 1
ELSE
0
END
END
END
END ) Tot_Null
FROM T
/

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a delimiter in sas?

739


what is 'mysqlcheck'? : Sql dba

757


How do I find duplicates in the same column?

735


Can we rollback after truncate?

764


Is sql developer case sensitive?

734


What is the most important ddl statements in sql are?

736


explain the options of myisamchk to improve the performance of a table. : Sql dba

737


Why triggers are used?

749


What is sql in java?

768


What is sql partition function?

812


what is innodb? : Sql dba

776


can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible? : Sql dba

783


how to check server status with 'mysqladmin'? : Sql dba

791


What is the difference between union and union all command?

758


How many types of indexes are there in sql?

733