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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-08-12 : 07:48:47
|
| sql_geek writes "I have written a query using inner query loginc to get selected count of rows based on the criteria provided, however, the query is not the best perfomance wise when it comes to big tables as it takes more resources.I know that using CASE statements to get the count of rows should take less resources. I am however having issue doing group by in the query using CASE statement. Anybody has an input as how this can be done using CASE statements.thanks" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-12 : 07:51:57
|
| Is this?Select sum(case when col='somevalue' then 1 else 0 end) from your tableMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|