AKTUALIZOVÁNO CAST
na CHAR
SELECT `posts`.*, CAST(AES_DECRYPT(`posts`.`body`,SHA2(CONCAT('prefix',`users`.`guid`,'suffix'),512)) AS CHAR) as 'realbody'
FROM `posts` JOIN `users`
ON `posts`.`user` = `users`.`id`
ORDER BY `posts`.`id` DESC
Ukázkový výstup:
| ID | USER | ... | REALBODY | ---...------------------------ | 2 | 2 | ... | Post 2 | | 1 | 1 | ... | Post 1 |
Zde je SQLFiddle demo