SELECT billing_country, ROUND(SUM(total), 2) AS country_total FROM invoice GROUP BY billing_country HAVING country_total > (SELECT 10*AVG(total) FROM invoice) ORDER BY country_total DESC;
What I expected to happen:
Give me a table where only countries are listed that have a total sales which is 10 times higher then the average purchase total
What actually happened:
Which is the table that i expected.
I got feedback the table calculated is not correct and the code was not fixed correctly.
I’m at a loss. Someone any ideas?