It is known that the database has a table called dati, and a field title format is varchar, and the stored content is Chinese sentences of different lengths. How should it be written to output long sentences first and then short sentences? ?
I can’t achieve it by using select *from dati order by title! Ask God for help
SELECT * FROM dati ORDER BY LENGTH(title) DESC
The length of a string can also be calculated in MySQL. First calculate the length of the string, and then arrange it backwards according to the length, and you can achieve it
select *from dati order by length(title);
Arranged in descending order by length