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 |
wtite down triggr not any entry on Sunday
What are the different types of constraints?
using cursors salesman get bonus as 10% of their salary , managers get 20% , analalist get 30%. generae a report showing the employee name, salary , bonus.
What is sql character function?
What are pl/sql cursor exceptions?
Explain cursor types?
What is sql*loader?
What SQL keyword must immediately follow the UNION ALL statement? 1. SELECT 2. INTO 3. ORDER 4. WHERE 5. JOIN
tell me about various levels of constraint. : Sql dba
overloading of stored procedure is possible in oracle?
Define tables and fields in a database
How to select unique records from a table?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)