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 |
|
SMerrill
Posting Yak Master
206 Posts |
Posted - 2009-11-24 : 17:38:50
|
| SELECT * FROM #TempTrackingID DaysBetweenEvents1 12 43 34 305 176 197 17...I want a statistical counting of the above:with columns <0, 0-10, 11-20, 21-30, 31+I know there are new fancy ways to compute the count in each numeric-range bin. Please give me one such technique.~ Shaun MerrillSeattle, WA |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-25 : 02:02:06
|
| Like thisselect sum(case when DaysBetweenEvents between 0 and 10 then 1 else o end) as [0-10],sum(case when DaysBetweenEvents between 11 and 20 then 1 else o end) as [11-20],..from your_tableMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|