SELECT FROM_UNIXTIME(addtime, '%Y%m%d') DAY, type, count(1) FROM itz_sms_queue where addtime>0 GROUP BY DAY, type order by DAY desc ;