这个sql如何优化 
当前是这样解决问题的
select * from
(
select b.name, count(a.eid) from  (select eId,uId from S where status=1and curdate>='2009-06-01' and
curdate<'2009-07-01' group by eId)a  ,  User b where a.uId=b.id group by a.uId
union all
select null, count(*) from (select eId,uId from S where status=1and curdate>='2009-06-01' and
curdate<'2009-07-01' group by eId)a  ,  User b where a.uId=b.id 
)c 
order by od
)上面的sql功能是分组统计每个月的eId并最后求sum,这里 select null, count(*) from (select eId,uId from S where status=1and curdate>='2009-06-01' and
curdate<'2009-07-01' group by eId)a  ,  User b where a.uId=b.id 
)c 
order by od
仅仅是为了统计前面分组统计的(union all之前的sql)分组的count的sum。
思考 这2个sql 能够在mysql里合并成一个sql吗?? (也就是不用union all)