CHAR_LENGTH
を使用する必要があります 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
違いを確認することをお勧めします: CHAR_LENGTH()vs LENGTH()