Problem with compare value with its aggregate function within the same table
Just use a common table expression:

WITH CustTotals AS ( ... your query above ...)
SELECT *
FROM CustTotals
WHERE customer_total &gt; (SELECT AVG(customer_total)
                        FROM CustTotals);