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.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / kishore vakiti
select sum(decode(a,null,1))+
sum(decode(b,null,1))+
sum(decode(c,null,1))+
sum(decode(d,null,1)) tot_nulls from <TAB-NAME>;
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / kavitha neditunta
select
count(decode(val,null,1)) all_null_val
FROM
(select * from t1) UNPIVOT INCLUDE NULLS ( VAL for(
all_null_val) in ( a as 'a', b as 'b', c as 'c', d as 'd') )
Is This Answer Correct ? | 0 Yes | 0 No |
Does oracle roll back the transaction on an error?
I have a tablle like this. cust acc --------------- a 1 b 2|3 c 4|5|6 I Want below o/p: cust acc ----------- a 1 b 2 b 3 c 4 c 5 c 6 Please any one can you have any ideas share me. I have urgent requirement.
Can I join the same table twice?
How is debugging done?
When a dml statement is executed, in which cursor attributes, the outcome of the statement is saved?
What is Data Concarency and Consistency?
How do I install microsoft sql?
What is query optimization in sql?
What are functions in sql?
What are the indexing methods?
How to Execute a Package in PL/SQL.?
What is a relationship and what are they?