很多时候都存了当前时间,没有单独存日期这个函数。查询按天查询的时候,需要转换成日期。
select DATE_FORMAT(create_time, "%Y-%m-%d") as day, count(DISTINCT(product_user_id)) as uv, count(product_user_id) as pv from dts_pay_order where client_id = 32 and create_time > '2023-03-01' and create_time < '2023-04-01' GROUP BY DATE_FORMAT(create_time, "%Y-%m-%d") ORDER BY create_time;
标签:-%,转换成,create,mysql,日期,time,id From: https://www.cnblogs.com/chen-msg/p/17285964.html