Same answer but "value doesn't look right"

Screen Link:

WITH customer_country_purchases AS 
    (SELECT country,
        c.first_name || " " || c.last_name as customer_name,
        round(SUM(, 2) total_purchases
    FROM invoice i
    customer c
    ON c.customer_id = i.customer_id
    GROUP BY 1,2
    ORDER BY 1), 
    max_country_purchase AS
     MAX(total_purchases) total_purchased
     FROM customer_country_purchases
     GROUP BY 1)
country, customer_name, total_purchased
FROM max_country_purchase


What I expected to happen:

i thought this would return the correct answer and it did.

What actually happened:

but im getting the message that the value isnt quite right. 

i need help figuring out what im doing wrong.

Hi @rayolufadeju, your code is correct but it is not accepted because the suggested answer does not ROUND up the total_purchased column. Remove the ROUND function from the line below and the answer is accepted.

> round(SUM(, 2) total_purchases


1 Like

Thank you!
Interestingly, I only added the ROUND function because I kept getting errors.
I looked at other posts with the same problem and tried to fix it myself.
I noticed many people didn’t get the GROUP BY correctly, so I adjusted that.
must have forgotten to remove the ROUND.

I’ll go back and re-examine my code.
Thanks for your help.

1 Like