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 |
pithhelmet
Posting Yak Master
183 Posts |
Posted - 2007-09-28 : 10:34:15
|
Hi everyone,I have a dump of sql performance matrixThe column in question is durationI need to get a count of records thatfall between these ranges...< .02 sec..02 to .1 sec..1 to .5 sec.5 to 5.0 sec.> 5.0 sec.what would the query be to get these counts??thankstony |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-09-28 : 10:37:42
|
[code]select sum(case when duration < .02 then 1 else 0 end) as [< .02 sec], sum(case when duration >= .02 and < .1 then 1 else 0 end) as [.02 to .1 sec][/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
pithhelmet
Posting Yak Master
183 Posts |
Posted - 2007-09-28 : 12:36:33
|
PERFECT!!!thank you! |
 |
|
|
|
|