SELECT DATE_FORMAT(RQSTDATE,'%m'), DATE_FORMAT(RQSTDATE,'%Y'), COUNT(*) FROM TABLE, (select min(submissionDate) m FROM TABLE) mini, (select MAX(submissionDate) m FROM TABLE) maxi WHERE RQSTDATE BETWEEN mini.m AND maxi.m GROUP BY DATE_FORMAT(RQSTDATE,'%m'), DATE_FORMAT(RQSTDATE,'%Y') ORDER BY RQSTDATE
|