select
pay_ability,
concat (
round(
count(distinct overdue_days) / count(distinct lt.customer_id) * 100,
1
),
'%'
) as overdue_ratio
from
loan_tb lt,
customer_tb ct
where
lt.customer_id = ct.customer_id
group by
pay_ability
order by
overdue_ratio desc;

京公网安备 11010502036488号