You can use the following SQL query to get the top 5 customers with the highest average invoice amount:

```
SELECT customer_id, AVG(amount) AS avg_amount
FROM invoices
GROUP BY customer_id
HAVING COUNT(invoice_id) >= 10
ORDER BY avg_amount DESC
LIMIT 5;
```

This query first groups the invoices by customer, calculates the average amount for each customer, and then only includes customers who have made 10 or more purchases using the `HAVING` clause. The results are sorted in descending order by average amount, and only the top 5 results are returned using the `LIMIT` clause.
Supponiamo di avere una tabella denominata &quot;fatture&quot; con colonne &quot;invoice_id&quot;, &quot;customer_id&quot;, &quot;invoice_date&quot; e &quot;amount&quot;. Scrivi una query SQL per trovare i primi 5 clienti che hanno l'importo medio della fattura più alto, escludendo i clienti che hanno effettuato meno di 10 acquisti.