MAX is an aggregate function. When dealing with a numeric column data type, it will return the highest value. For character columns, MAX finds the highest value in the collating sequence. Either way, it will only return one value per group - if no groups are specified, it will only return one value.
That leaves you with needing to get the length of the body so you can order the results - you have two options:
- LEN returns the number of characters, rather than the number of bytes, of the given string expression, excluding trailing blanks.
- DATALENGTH returns the number of bytes used to represent any expression. DATALENGTH is especially useful with varchar, varbinary, text, image, nvarchar, and ntext data types because these data types can store variable-length data. The DATALENGTH of NULL is NULL.
So you'd want to use the following query:
SELECT TOP 10 p.body
FROM POSTS p
ORDER BY DATALENGTH(p.body) DESC