SELECT T1.city,T1.total_order_amount FROM 
(
SELECT  C.customer_id,C.city,SUM(O.total_amount) AS total_order_amount
FROM orders  AS O
LEFT JOIN customers  AS C
ON C.customer_id=O.customer_id
GROUP BY C.customer_id,C.city
ORDER BY total_order_amount DESC ,C.city ASC
) T1;