Here is an example SQL query that should achieve the desired outcome:

```
SELECT customer_id, SUM(amount) as total_spend
FROM transactions
WHERE transaction_date >= DATEADD(month, -6, GETDATE()) -- Get transactions from the last 6 months
GROUP BY customer_id
HAVING COUNT(DISTINCT DATEDIFF(month, 0, transaction_date)) = 6 -- Exclude customers who have not made transactions in the last 6 months
ORDER BY total_spend DESC
LIMIT 1;
```
 
This query uses the `SUM` function to calculate each customer's total spend, and groups the results by customer ID. It then filters out any customers who haven't made any transactions in the last 6 months using the `HAVING` clause. Finally, the results are sorted by total spend in descending order, and the `LIMIT 1` clause returns only the customer with the highest spend.
Supponiamo di avere una tabella denominata &quot;transactions&quot; con le colonne &quot;transaction_id&quot;, &quot;customer_id&quot;, &quot;transaction_date&quot; e &quot;amount&quot;. Scrivi una query SQL per trovare il cliente con la spesa totale più alta negli ultimi 6 mesi, escludendo i clienti che non hanno effettuato transazioni negli ultimi 6 mesi.