SELECT c.country, SUM(i.total) AS total
FROM invoice AS i
JOIN customer AS c
ON i.customer_id = c.customer_id
GROUP BY c.country;
What I expected to happen:
get a total of sales of each country
Replace this line with the output/error
Is incorrect because:
- The set of columns used in the join conditions of the query is not correct. For example, column
customerwas not used.
why? what do I do wrong?