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