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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 query help needed

Author  Topic 

mboef
Starting Member

1 Post

Posted - 2005-05-10 : 04:29:29

i have a table with the columns state and dossierclaimd
the 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

any help is welcome thank you

   

- Advertisement -