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 / mathan r

create table clustering
(
id1 varchar(10),
id2 varchar(10),
id3 varchar(10)

)

insert into clustering
select '1','2',null
union
select '1',null,'3'
union all
select null,'2','3'

select sum(nullable) from
(select count(case when id1 = null then '1' else '2' end) 'nullable' from clustering where id1 is null
union all
select count(case when id2 = null then '1' else '2' end)'nullable' from clustering where id2 is null
union all
select count(case when id3 = null then '1' else '2' end)'nullable' from clustering where id3 is null ) tmp

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of sql?

773


What is pl sql block structure?

719


Where are my tempfiles, I don't see them in v$datafile or dba_data_file?

734


What are the two characteristics of a primary key?

667


What is difference between sql function and stored procedure?

679






Define overloaded procedure?

803


What are the types of functions in sql?

743


What is the primary key?

698


What is the difference among union, minus and intersect?

731


How do I know if I have sql express or standard?

755


How do I write a sql query in pgadmin 4?

712


What is the most restrictive isolation level? : Transact sql

768


How can you create an empty table from an existing table?

797


What is insert command in sql?

765


What are the benefits of pl sql?

765