select month(createtime) month ,count(distinct insId) num
from aa
where convert(varchar(4),createtime,120)= year(getdate())
group by month(createtime)
这是sql ,我想查询12个月的数据,但现在只有 11月份有数据,我想列出其他月份,并且num 是0