日期:2014-05-17 浏览次数:20478 次
SELECT DATE_FORMAT(a.m_adddate,'%Y%m') as Ym, count(*) as `当月`,
(select count(*) from job_myreceive where
DATE_FORMAT(a.m_adddate,'%Y%m') = DATE_FORMAT(DATE_add(m_adddate,INTERVAL 1 MONTH),'%Y%m')
) as 上月
FROM job_myreceive a group by 1
Ym 当月 上月
201012 6 0
201101 2 6
201105 1 0
201107 2 0
201112 1 0
201305 1 0