Here is a table structure (e.g. test):
Field Name | Data Type |
---|---|
id | BIGINT (20) |
title | varchar(25) |
Description | Text |
Here is a table structure (e.g. test):
Field Name | Data Type |
---|---|
id | BIGINT (20) |
title | varchar(25) |
Description | Text |
SELECT * FROM TEST ORDER BY LENGTH(description) DESC;
The LENGTH
function gives the length of string in bytes. If you want to count (multi-byte) characters, use the CHAR_LENGTH
function instead:
SELECT * FROM TEST ORDER BY CHAR_LENGTH(description) DESC;