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
Explain aggregate functions are available there in sql?
What is pl/sql table? Why is it used?
List out the acid properties and explain?
how to create a new table in mysql? : Sql dba
Which join is default?
How to create a menu in sqlplus or pl/sql?
What is the use of procedures?
What is a constraint?
Can we join 3 tables in sql?
What is the syntax and use of the coalesce function?
a table has 2 classifications 1)liabilities 2)earnings this liabitity has 2 elements with 2 input values and the earnings have 2 elements with 2 input values i wrote a query so that my input is liability savings amount1 amount2 xxxx null xxxxxx 0 xxx1 null xxxxx1 0 null yyyy 0 yyyy null yyy1 0 yyy1 my problem is --when i developed a report(d2k) with this data my o/p is liabilities,amount1,savings,amount2 xxxx xxxxxx xxx1 xxxxx1 yyyy yyyy yyy1 yyy1 how could i move this savings,savings values 2 palces up. can any body provide me witha better solution
Explain two easy sql optimizations.
what is 'mysqlimport'? : Sql dba
Is mariadb a nosql database?
when is the use of update_statistics command? : Sql dba