select cliente, total from ( select cliente, sum(importe) as total from facturas group by cliente )order by total