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
 SQL Server Development (2000)
 count rows which & which don't correspond to the where-clause

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-01-23 : 09:40:07
Karin writes "My table is something like this, for instance;
How someone travels, more than one type of transport is possible.

Name, Transport
Peter, 0
Peter, 1
Peter, 5
Chris, 0
Chris, 3
John, 5
Stefan, 0
Stefan, 3
Hedrik, 1

where 0 = not engine-powered transport and everything besides 0 = engine-powered transport

I want to get an overview like this:
Name, Transport=0, Transport<>0
Peter, 1, 2
Chris, 1, 1
John, 0, 1
Stefan, 1, 1
Hendrik, 0, 1

So I want to see the count of the rows which & which don't correspond to the where-clause.
How do I get this?

Hope someone can help me out...
Thanx"
   

- Advertisement -