题解 | 分析客户逾期情况
分析客户逾期情况
https://www.nowcoder.com/practice/22633632da344e2492973ecf555e10c9
select a.pay_ability, concat(round(100*count(distinct case when overdue_days is not null then b.customer_id else null end) / count(distinct a.customer_id) ,1),'%') as overdue_ratio from customer_tb a join loan_tb b on a.customer_id=b.customer_id group by a.pay_ability order by overdue_ratio desc