Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

Wrong error message

Link to question: https://teamtreehouse.com/library/reporting-with-sql/working-with-text/getting-the-length-of-a-string My code: select title, length(title) as longest_title from books order by length(title) desc limit 1; Answer: Harry Potter and the order of the Phoenix The answer above is in the column "title" the column next to it is "longest_length" I checked to make sure this was the correct by retrieving all the titles in the descending order. So I know I've got the correct answer.

However, I'm getting an error message saying: Bummer: Your query didn't return the longest length

Thank you! I caught that soon after I posted :)

1 Answer

Steven Parker
Steven Parker
229,657 Points

You have the right book, but the wrong column name.

The instructions say, "Alias the result of the length calculation to be longest_length".
But your query aliases it to "longest_title" instead.