SELECT DATE_FORMAT(GenerateTime, '%m') as month, SUM(GenerateCount) AS count FROM identitycodetask
WHERE DATE_FORMAT(GenerateTime, '%Y')='' AND ProductId=''
GROUP BY DATE_FORMAT(GenerateTime, '%Y-%m')
SELECT DATE_FORMAT(GenerateTime, '%m') as month, SUM(GenerateCount) AS count FROM identitycodetask
WHERE DATE_FORMAT(GenerateTime, '%Y')='' AND ProductId=''
GROUP BY DATE_FORMAT(GenerateTime, '%Y-%m')