提问一个SQL 统计group by
select b.city,datepart(hh,a.logtime) as hh,isnull(count(b.city),0) as num from smsrec a join
(
select distinct * from areacode where city in
('青岛', '烟台', '威海', '日照', '济南', '淄博', '德州', '潍坊', '济宁', '泰安', '临沂', '滨州', '东营', '枣庄', '莱芜', '聊城', '菏泽')
) b
on left(a.手机号,4)=b.区号
where datediff(d,a.logtime,getdate())=1
group by b.city,datepart(hh,a.logtime)
order by city,hh
我要的结果是: 地市1 0点 数量
.......
地市1 23点 数量
地市2 0点 数量
........
地市2 23点 数量
........
但,我统计出来的数据为0的确不显示,请问各位高手该怎么写?