Welcome to the Treehouse Community
Looking to learn something new?
Grabbing a count of genres in a library table
Im working on this challenge:
here is my query:
select distinct count(genre) as total_genres from books;
The error is "Your query does not have the right count".
Whats wrong with my query?
Steven Parker216,012 Points
You have "distinct" in the wrong place.
A single aggregate field is always distinct, so it doesn't do anything in front of count. But it would make a difference in the count itself if you put it inside the count function.
Thanks, worked fine and im on to the next step!