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 |
cutiebo2t
Constraint Violating Yak Guru
256 Posts |
Posted - 2010-04-22 : 22:33:22
|
Hi,I have this table:Name PriorityRoel AgingRoel Within 24Noel Within 24Roel AgingNoel AgingRoel AgingWhat I want is to count Priority showing this results:Name Aging Withing 24Roel 3 1Noel 1 1 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-04-22 : 22:35:15
|
are you using SQL Server 2005 / 2008 ? KH[spoiler]Time is always against us[/spoiler] |
|
|
cutiebo2t
Constraint Violating Yak Guru
256 Posts |
Posted - 2010-04-22 : 22:36:14
|
2000 Sir |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-04-22 : 22:38:50
|
[code]select [Name], count(case when Priority = 'Aging' then Priority end) as [Aging], count(case when Priority = 'Within 24' then Priority end) as [Within 24]from yourtablegroup by [Name][/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
cutiebo2t
Constraint Violating Yak Guru
256 Posts |
Posted - 2010-04-22 : 22:41:03
|
got it thanks. that was helpful. |
|
|
|
|
|