# 按天统计数据
select
DATE_FORMAT(f_create_time,'%Y-%m-%d') as dt,
count(*) as cnt
from t_trans_07_0
where f_create_time>='2020-03-01'
group by dt;
本文介绍了一种使用SQL查询按天统计交易数据的方法,通过日期格式化和分组函数,可以有效获取每天的交易次数。
# 按天统计数据
select
DATE_FORMAT(f_create_time,'%Y-%m-%d') as dt,
count(*) as cnt
from t_trans_07_0
where f_create_time>='2020-03-01'
group by dt;

被折叠的 条评论
为什么被折叠?