22

I'm using the following query to print all title from stories table

select title from stories;

which show me all titles , The point here how to tweak it and do the following :

`order by longest title or even count longest title` 

any tips

1
  • 2
    select title from stories order by char_length(title) desc? Commented Apr 2, 2014 at 7:13

1 Answer 1

53

If you to order by the length of the title (longest to shortest) you should use the following query

select title from stories order by length(title) desc
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.