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

donald kaiser
donald kaiser
9,736 Points

My code isn't working when trying to do reporting with SQL. I can't understand why it won't work.

Here is the code I tried and it's telling me there's something wrong with the code. It's not saying what the problem is:

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

https://teamtreehouse.com/library/reporting-with-sql/working-with-text/getting-the-length-of-a-string

3 Answers

Steven Parker
Steven Parker
231,271 Points

When I try, it says the problem is "no such column: length".

I'll bet you intended to "ORDER BY" the longest_length alias instead of "length".

donald kaiser
donald kaiser
9,736 Points

Ahh!! Thanks for the help sir that worked.

donald kaiser
donald kaiser
9,736 Points

Oh, thank you. I didn't know that Thanks.