Databases Reporting with SQL Working with Text Getting the Length of a String

Stephanie Albright
Stephanie Albright
5,209 Points

Help please

This is my code: SELECT title, LENGTH(title) AS length FROM books ORDER BY length DESC limit 1;

It works in the Playground but not in the exercise. Not sure what I did wrong.

3 Answers

KRIS NIKOLAISEN
KRIS NIKOLAISEN
53,693 Points

According to the instructions your alias should be longest_length

Stephanie Albright
Stephanie Albright
5,209 Points

I tried that too and it didn't work.

KRIS NIKOLAISEN
KRIS NIKOLAISEN
53,693 Points

Did you change it in your order by clause as well? The following passed for me:

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