Using Oracle Count Aggregate with different criteria

Can someone provide an example where I can use count to count the rows in columns meeting different criteria?

Example: I want to count the number of rows that have a value of zero in a column, and I want to count the number of rows in the same column with a different value.

I tried something similar to:

Select
Count ( Select Column1 From Table1 where criteria1 = 0) as First ,
Count ( Select Column1 From Table1 where criteria1 <> 0) as Second

From Table1

Where criteria2 = something and criteria3 = somethingelse

I can't seem to get it to work, but I'm just a hack when it comes to SQL.
[670 byte] By [MonteyPython] at [2007-11-19 23:09:19]
# 1 Re: Using Oracle Count Aggregate with different criteria
try case and sum.

select sum(case when criteria1=0 then 1 else 0 end) as first,
sum(case when criteria1<>0 then 1 else 0 end) as second
from table1
Where criteria2 = something and criteria3 = somethingelse
f_eriksen at 2007-11-9 13:43:47 >
# 2 Re: Using Oracle Count Aggregate with different criteria
It works! Thanks!
MonteyPython at 2007-11-9 13:44:47 >