Count the product orders


#1

select name, COUNT(DISTINCT order_id)
from order_items
group by 1
order by 1;

What's wrong here?
I get this error message: Count the product orders.


#2

i have same problem and also don't know were the problem :S


#3

that is the correct code. refresh your browser :smile:


#4

@boardpro99607

You have the right code. Just lower case it! That's worked for me!

select name, count(distinct order_id)
from order_items
group by 1
order by 1;

Seems like Codecademy parser is real picky on syntax. Also, generally it's wise to mimic the syntax of the lesson. So if they're lower-casing the major functions which are usually uppercase, then you should too.

Best! :wink: