Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



i have table T!. A B C D NULL 1 2 3 4 NULL 5 6 7 8 NULL ..

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

i have table T!. A B C D NULL 1 2 3 4 NULL 5 6 7 8 NULL ..

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

i have table T!. A B C D NULL 1 2 3 4 NULL 5 6 7 8 NULL ..

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

i have table T!. A B C D NULL 1 2 3 4 NULL 5 6 7 8 NULL ..

Answer / sreenu

hi naren thank for your ans.

but here i am asking total count of null records. means how
many null values are there.

see above table having 4 null values. i want display "4".

please tell me sql query

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

suppose we have values like 1 5 7 in a colum.Now we want numbers like(2 3 4 6) that exists between 1 5 7.How can we do this using sql query??

5 Answers   Keane India Ltd,


What is auto increment feature in sql?

0 Answers  


does sql support programming? : Sql dba

0 Answers  


How many triggers can be implemented for a table?

3 Answers   HSBC,


what is inline command?

2 Answers  


Why do we use sqlite?

0 Answers  


What is pragma in pl sql?

0 Answers  


What is ttitle and btitle?

0 Answers  


What is the difference between explicit and implicit cursors in oracle?

0 Answers  


Show the two pl/sql cursor exceptions.

0 Answers  


How to rename a column in the output of sql query?

0 Answers  


what is a composite primary key ? : Sql dba

0 Answers  


Categories