Musisz użyć CHAR_LENGTH
zamiast LENGTH
SELECT a.id, a.post_id, a.body
FROM posts a INNER JOIN
(
SELECT post_ID, title, MAX(CHAR_LENGTH(body)) totalLength
FROM posts
GROUP BY post_ID, title
) b ON a.post_id = b.post_ID AND
a.title = b.title AND
CHAR_LENGTH(a.body) = b.totalLength
Możesz chcieć zobaczyć różnicę:CHAR_LENGTH() vs DŁUGOŚĆ( )