Count NULL Values from multiple columns with SQL -


i have 3 columns let a, b, , c. need count null values in each column.

for example:

  | b  | c ------------- 1   |null| 1 1   | 1  | null null| 1  | 1 null|null| 1 

should output:

  |  b  |  c ---------------  2  |  2  |  1 

i've tried count, sum, sub-queries nothing has worked me yet. input appreciated!

select count(*)-count(a) a, count(*)-count(b) b, count(*)-count(c) c yourtable;  

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -