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-05-11 : 07:30:21
|
| marco writes "mine problem is as followsi have a table with the columns state and dossierclaimdthe column State has the values 0,1,2,5 in it and the column Dossierclaimd is a bit column.Is it possible to produce a query which has the result(state =0 or state =5) and dossierclaimd= 0 avg( something)state <>0 or state <>5 and dossierclaimd= 0 avg( something)group by state if i case statements and group it by state the query results in all possible combinations between state and dossierclaimd.the result i want is a two row tabel with state =0 or state =5 and dossierclaimd= 0 avg( something)state <>0 or state <>5 and dossierclaimd= 0 thank youmarco" |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2005-05-11 : 07:51:12
|
| You need to rethink you logic, because the following condition will always be true (unless state is null):state <> 0 or state <>5 Maybe something like:state not in (0,5)CODO ERGO SUM |
 |
|
|
|
|
|