Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
renu
Starting Member
47 Posts |
Posted - 2007-11-29 : 04:46:47
|
How to get the count of null values ?Renu |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-11-29 : 04:49:54
|
[code]Select sum(Case when col1 is null then 1 else 0 end) as col1_cntfrom table[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2007-11-29 : 04:56:10
|
select count(1) from table where col is null |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-11-29 : 07:09:31
|
Different approachSelect count(*)-count(col) from tableMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|