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 Reporting with SQL Working with Text Getting the Length of a String

Abiel Ortega
Abiel Ortega
2,171 Points

I don't see whats wrong

I don't see what's wrong with the code I presented its correct I know it is but it shows I'm not right that its wrong. So Idk what to do

1 Answer

Moosa Bonomali
Moosa Bonomali
6,297 Points

Here is how I implemented it;

SELECT title, MAX(LENGTH(title)) as longest_length from books
Abiel Ortega
Abiel Ortega
2,171 Points

Thank you so much, in the end, I figured it out just now I tested it out and I came out with this

SELECT title, LENGHT(title) AS longest_length FROM books ORDER BY longest_length DESC LIMIT 1;

This actually really worked and came out right. I also tried it in the workspace and it came out all good

THANK YOU!!!