题解 | 获取指定客户每月的消费额
select left(t_time,7) as time,round(sum(t_amount),1) as total from trade a left join customer b on a.t_cus=b.c_id where c_name='Tom' and year(t_time)=2023 and t_type=1 group by time order by time
select left(t_time,7) as time,round(sum(t_amount),1) as total from trade a left join customer b on a.t_cus=b.c_id where c_name='Tom' and year(t_time)=2023 and t_type=1 group by time order by time
相关推荐