按天:%Y-%m-%d
select DATE_FORMAT(create_time,'%Y-%m-%d') tm, count(*) from t_xx where group by tm
select count(*) from t_xx where create_time > "2023-04-01" and create_time < "2023-04-02"
或者
SELECT DATE(createTime) AS date, COUNT(*) AS count FROM your_table GROUP BY DATE(createTime)
按秒:%Y-%m-%d %H:%i:%s
select DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%s') tm, count(*) from t_xx where group by tm