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.

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 is cascade in sql?

914


How is data stored on a disk?

962


Explain locks? : Transact sql

951


Can you have more than one trigger on a table?

940


What are joins in sql?

956


How do I filter in sql profiler?

948


What is a field in a database?

1005


Can you inner join the same table?

934


Is it possible for a table to have more than one foreign key?

976


Does sql require a server?

942


what is text? : Sql dba

1007


explain the advantages and disadvantages of stored procedure? : Sql dba

956


How do you respond to dementia behavior?

925


what is the difference between group by and order by in sql? : Sql dba

1053


What does <> sql mean?

987