Если вам нужно использовать count (для возврата 0, если присутствуют нулевые значения), вы можете использовать оператор case в функции count для достижения этого.
declare @city table (
City char(15),
A int,
B int,
C int
);
insert @city (City, A, B, C)
values
('Boston', 1, 1, 1),
('Chicago', 1, 0, 0),
('Boston', 1, 0, 0),
('Boston', 1, 1, 0),
('Chicago', 1, 1, 0);
select * from @city;
select City,
count(case when A>0 then 1 end) as CountA,
count(case when B>0 then 1 end) as CountB,
count(case when C>0 then 1 end) as CountC
from @city group by City;
