Here is my code:
SELECT
c.customer_id,
c.first_name,
c.last_name,
SUM(oi.quantity * oi.unit_price) AS spendings
FROM customers c
JOIN orders o USING (customer_id)
JOIN order_items oi USING (order_id)
WHERE state = ‘VA’
ORDER BY
c.customer_id,
c.first_name,
c.last_name
HAVING spendings > 100
Resulting Error Code:
Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘HAVING spendings > 100’ at line 12
Thank you for your help.