Welcome to the Treehouse Community
Looking to learn something new?
Robbie Thomas31,093 Points
Getting the length of a string
Not exactly sure what they want here. This is my answer:
SELECT books, LENGTH(title) AS "longest_length" FROM title ORDER BY length DESC LIMIT 1;
Gabriel Pierce-Lackey11,014 Points
Okay, a few things. first, you don't need the quotes around longest_length or around any alias. its just name AS nm. Ya know. Secondly were taking the title from the table books, not the column books from the table title. And sine we want the length of the title as well. Were selecting title twice, one is going to the length.
SELECT title, length(title) as longest_length FROM books order by longest_length desc limit 1;