select ct.pay_ability, concat(round(100*count(distinct case when lt.overdue_days is not Null then lt.customer_id end)/count(distinct lt.customer_id),1),'%') as overdue_ratio from customer_tb as ct left join loan_tb as lt on ct.customer_id =lt.customer_id group by pay_ability order by overdue_ratio desc