您可以使用%c格式化没有前导零的月份并%e格式化月份的日期:
%c
%e
SELECT DATE_FORMAT(earning_created, '%Y, %c, %e') AS day, -- Here! SUM(earning_amount) AS amount FROM earnings WHERE earning_account_id = ? GROUP BY DATE(earning_created) ORDER BY earning_created