mysql日期格式化
mysql表中字段event_time是时间戳格式,希望查询结果以固定格式展示,因此需要使用data_format。
具体使用方法如下:
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