select convert(int,SUBSTRING(t.fmonth,6,2))fmonth, sum(t.fcount) fcount, t.freception_address
from (
         select convert(varchar(7),t1.fdate,120)              fmonth,
                t1.freception_address,
                count(t1.freception_address) fcount
         from tcustomer_reception t1
         inner join tagents t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid
         where t1.ftype = '½Ó´ý'
           and t1.siteid =$siteid$
           and t2.fsaleruserid in $tenterprise_userid$
           and convert (varchar (7)
             , t1.fdate
             , 120)>=$fbegmonth$
           and convert (varchar (7)
             , t1.fdate
             , 120)<=$fendmonth$
         group by t1.freception_address, convert(varchar(7),t1.fdate,120)
         union all
select t1.fmonth, t2.freception_address, 0 as fcount
from tmonthlist t1
         inner join (
    select 'ÍâÇÚ' freception_address
    union all
    select 'Âô³¡' freception_address
) t2 on t1.fmonth>=$fbegmonth$ and t1.fmonth<=$fendmonth$ and t1.fmonth<=convert(varchar(7),GETDATE(),120)
    )t
group by convert(int,SUBSTRING(t.fmonth,6,2)), t.freception_address
order by convert(int,SUBSTRING(t.fmonth,6,2))