SELECT DATE_FORMAT(FROM_UNIXTIME(uCheckSPassTime),’%Y-%m-%d’) AS d ,COUNT(*) AS so_count FROM `bc_User`
WHERE CheckStates = 2
AND DATE_FORMAT(FROM_UNIXTIME(uCheckSPassTime),’%Y-%m-%d’) BETWEEN ‘2007-11-01’ AND ‘2007-11-30′
GROUP BY DATE_FORMAT(FROM_UNIXTIME(uCheckSPassTime),’%Y-%m-%d’)
SELECT DATE_FORMAT(FROM_UNIXTIME(uCheckSPassTime),’%Y-%m’) AS m ,COUNT(*) AS so_count FROM `bc_User`
WHERE CheckStates = 2
AND DATE_FORMAT(FROM_UNIXTIME(uCheckSPassTime),’%Y-%m’) BETWEEN ‘2007-11’ AND ‘2009-11′
GROUP BY DATE_FORMAT(FROM_UNIXTIME(uCheckSPassTime),’%Y-%m’)