I have a table table1
that has a field1
has values from 1 to 5 I need to get the count of records when field1 = 1
and the count of remaining records when field1 <> 1
. so I could do it like this:
select count(*) from table1
group by field1 = 1
however this will give me the two correct values as two records in the result but I wonder is there a way to get the two count values as columns in one select SQL ?