Jump to content

Archived

This topic is now archived and is closed to further replies.

oracle259

Arranging mysql result by result length

Recommended Posts

How do i order my mysql results by the longest length eg


I have the following words in the db

string
stringest
stringer

how do i get the following results

stringest
stringer
string

Share this post


Link to post
Share on other sites
ORDER BY LENGTH(yourField) DESC

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.