select time,sum(if(t_type = 1,t_amount,0)) as total from( select substring_index(t_time,"-",2) as time, t_type , t_amount,c_name from( select * from trade t inner join customer c on t.t_cus =c.c_id ) a where year(t_time) = 2023 ) b where c_name =...