select a.订单号,sum(b.金额)/sum(a.金额) as 退款率 from 订单表 a 
left join 退款表 b
on a.订单号 = b.订单号 and b.商品号 = a.商品号
group by a.订单号
order by a.订单号