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 trialChris Craigman
13,659 PointsI don't know what I'm doing wrong with my SQL code
It wants me to find the longest length title in the books category and I did just that but its telling me that I haven't retrieved the book with its length. Yet when I look I clearly have
1 Answer
Corey Montgomery
18,468 PointsThe problem looks to be that the instructions are asking for "longest_length" and you are calling the field "length calculation." Swap those around and it should pass just fine. Here is the code:
SELECT title,LENGTH(title) AS longest_length FROM books ORDER BY LENGTH(title) DESC LIMIT 1;
Hope that helps.
Chris Craigman
13,659 PointsChris Craigman
13,659 PointsThe challenge is in PHP Intermediate Getting The Length of a String task and my code is
SELECT title,LENGTH(title) AS "length calculation" FROM books ORDER BY LENGTH(title) DESC LIMIT 1;