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 |
|
paultervit
Starting Member
10 Posts |
Posted - 2008-07-09 : 09:43:48
|
| Hello AllIs it possible to run a count on cells that have values only egI have the following tablePC TD1 341 35 2 362 NULL3 NULL3 NULLI would like to run a query to get the following backPC COUNT1 22 13 NULLIs this possible?ThanksPaul |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-09 : 09:46:19
|
[code]select PC, count(TD)from tablegroup by PC[/code]You want PC 3 Count 0 to show as NULL ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
paultervit
Starting Member
10 Posts |
Posted - 2008-07-09 : 10:05:47
|
| Thanks again khtan. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-09 : 11:53:31
|
| Count never returns NULL. if you want NULL in result, you need to use NULLIF to convert 0s to NULL. |
 |
|
|
|
|
|