With the following query I am getting the error unknown column a.id in where clause. I'm basically trying to add a limit of 5 to what would have been two left joins. Is it possible to rewrite this query so it can work?
SELECT
CONCAT_WS(' ',(
SELECT GROUP_CONCAT(body,' ') FROM (
SELECT c.body FROM c WHERE c.id IN (
SELECT id_c FROM b WHERE b.id_a=a.id
)
LIMIT 5
) c
)) AS contents
FROM
a
Full SQLfiddle at http://sqlfiddle.com/#!9/c1822/3
Find_in_set works http://sqlfiddle.com/#!9/2d43bb/1 but it is extremely slow with large datasets