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 |
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2011-10-06 : 06:33:14
|
I now haveselect ddi,count(d),sum(duration),sum(rate) from #stats group by ddiI want to add another count that counts how many fields for the same ddi have a null rate How can I do this within the select statement? |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-10-06 : 06:45:42
|
Try:select ddi,count(d),sum(duration),sum(rate),sum(case when rate IS NULL then 1 else 0 end) as NULLrate from #stats group by ddi No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2011-10-06 : 07:07:03
|
thanks |
 |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-10-06 : 07:45:05
|
welcome  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|