--Select employees whose salary is above the average in their office
-- GET invoices that are larger than the client's average invoice amount
SELECT *
FROM invoices i
WHERE invoice_total > (
SELECT AVG(invoice_total)
FROM invoices
WHERE client_id = i.client_id
)
output: