帆软用户LN7PzC1PwW(提问者)这个答案和我老师讲的有点类似,希望再多讨论一下,我的sql语句是:SELECT
(SUM(to_customer_in_cur_amounts) / (SUM(to_customer_in_cur_amounts) + SUM(between_in_year_amounts))) * 100 AS 对客户现金业务占比,
(SUM(between_in_year_amounts) / (SUM(to_customer_in_cur_amounts) + SUM(between_in_year_amounts))) * 100 AS 同业间现金业务占比,
year AS 年,
quarter AS 季
FROM
spreadjs_collect_bank_finace_cash_in_out
GROUP BY
year, quarter