mysql表中字段event_time是时间戳格式,但愿查询结果以固定格式展现,所以须要使用data_format。mysql
具体使用方法以下:sql
select id, user_id, site_id, customer, domain_id, ip, page, operation, type, client, app, date_format(event_time, '%Y-%m-%d') as optime, count(event_time) as c FROM user_log where customer = '4aa3d34a3f5a4f4a801d466f8040fc32' group by event_time