Statement I came up with:
SELECT p.user_id AS started_by,
p.position,
p.created AS started_time,
GROUP_CONCAT(
c.id,
c.user_id,
c.comment,
c.created) AS comments
FROM pointers AS p
JOIN comments AS c
ON p.id = c.pointer_id
WHERE p.archive_id = 3
GROUP BY p.id
It gets me:
What happens is that GROUP_CONCAT() simply concatenates c.id . c.user_id c.comment and c.created. I cannot even explode that value in any meaningful way. (Notice how date and id are together as 1 string).
I don't want to create separate query for comments. OR should I?
IN any case, I need orderby c.created the comments, and have two delimiters. for example:
comments => 1,1,text this is!,2014-12-20 17:52:02;3,1,asasd,2014-12-20 20:46:40